Jira Automation: Updating a Confluence page with information from Jira issues

27 comments

Danisse
Contributor
February 20, 2025

Hi @Hala ElRoumy  can you help me on my use case wherein what I want to happen is if a ticket is created it should create a new row on the table on the page but what it's. doing is just overwriting the exisiting entry.

Here's a snippet of my PUT function:


{
"id": "<<PAGE ID>>",
"type": "page",
"title": "<<PAGE TITLE>>",
"space": { "key": "<<PAGE KEY>>" },
"body": {
"storage": {
"value": "<table data-table-width=\"760\" data-layout=\"default\"><thead><tr><th><p><strong>Jira Ticket</strong></p></th><th><p><strong>Summary</strong></p></th><th><p><strong>Assignee</strong></p></th><th><p><strong>Created</strong></p></th></tr></thead><tbody>{{currentRows}}<tr><td>{{issue.key}}</td><td>{{issue.summary}}</td><td>{{issue.assignee.displayName}}</td><td>{{issue.created}}</td></tr></tbody></table>"
,
"representation": "storage"
}
},
"version": {
"number": {{webhookResponse.body.version.number.plus(1)}},
"minorEdit": true
}
}
Like Hala ElRoumy likes this
Hala ElRoumy
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 24, 2025

Hi @Danisse 

I got it to work by using this JSON in the value:

"value": "{{webResponse.body.body.storage.value.substringBefore("</tbody></table>").jsonEncode}}<tr><td>{{issue.key}}</td><td>{{issue.summary}}</td><td>{{issue.assignee.displayName}}</td><td>{{issue.created}}</td></tr></tbody></table>"

So basically, I extracted the part of the table before the table tags and then I added the new row and then closed the table tag and it worked!

Give it a try and let me know :)

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events