Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

30 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 :)

Like Troy Anderson likes this
Noah Dinlemez
Contributor
May 2, 2025

Hi @Hala ElRoumy @YY Brother 


This (API calls to confluence) is new for me and I haven't tried much yet. I'm looking to do something similar, but I imagine slightly more complex than in this post.

I saw this comment in this threat: 

About jira issue status update in confluence page, if you insert jira issue macro into the page, the jira issues' status will change accordingly in the confluence page (refresh) once jira issue's status is transitioned. 

I don't for your scenario, it seems we don't need automation.

However, I do need to use API/Automation to make happen what I want, so this answer doesn't work for me. 

I'm looking to update a specific part of a page, not redo the entire page or (as mentioned above) add another row to a page. I'd also prefer to have my own table or layout, not the limited one from the macro's.

I'm looking to update information from Assets onto a Confluence page for people who don't (always) have a JSM license. Because of this, the Assets-macro doesn't work for me as the users will get a no permission-block. Even if they did, the Assets-macro doesn't allow for much tweaking or one long list (it becomes a slide within the frame). 

When products/admins (as attributes) of the team (the main object) are updated, I'd like the automation to send this update, from the assets to the Confluence page. I'll try to recreate a part of such a table below:
'Before the update in the asset and the API sends the information': 

TeamAdminProduct
Team 1 Admin 1, admin 2, admin 3Product 1
Team 2 Admin 2, admin 4Product 2, product 3
Team 3 Admin 1, admin 5, admin 6Product 1, product 4

'After the API sends the information to Confluence', where team 2 has added an admin (admin 7). 

TeamAdmin 

Product 

Team 1Admin 1, admin 2, admin 3 Product 1
Team 2Admin 2, admin 4, admin 7Product 2, product 3
Team 3Admin 1, admin 5, admin 6Product 1, product 4

Basically meaning that there needs to be an API that update's that specific cell when that specific team-object has been updated.
I already have automations with API's working to allow team-admins to add/remove information to their assets, but I need that information nicely structured in (possible public) confluence pages. So it would be great if I could add to those automations with additional API's that make sure that updated information is also send to those 'cells'. 

 

Hopefully this is somewhat understandable, and hopefully you see a way you could help me with this!

Troy Anderson
Contributor
May 2, 2025

2024 is an 'old' article?  Have you searched in the Community Forums much??  :)

Any input on this error would be helpful:  

2025-05-02 10_17_10-Clipboard.png

The call:  

"status": "current"
,"version": {"number":{{#=}}{{webResponse.body.version.number}}+1{{/}}},
"title": "Engage Defects {{now.convertToTimeZone("America/Chicago").format("MM/dd/yyyy")}}","body":{"value":"{{webResponse.body.body.storage.value.JsonString||Key||Summary||Status||Updated||\n{{#lookupIssues}}|{{key}}|{{summary}}|{{status.name}}|{{updated.format("MM/dd/yyyy")}}|\n{{/}}","representation":"wiki"}

 

If I remove the ".JsonString", the error changes to:  2025-05-02 11_39_56-Clipboard.png

I have also tried changing the representation to "storage" instead of "wiki" and tried "\\n" just in case.   Same 'Illegal unquoted character' error.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events