Hi,
I spent some time working out how to, on a schedule, get the latest comment from a set of Jira Issues and then create a Confluence page with them as a summary.
It's not perfect, but could be a good start for people to build on.
Issues:
- Jira comments are in wiki format, but Confluence doesn't appear to support this
Here's what I did:
Create a scheduled task
Created a lookup Issues tasks that finds the set of Jira issues I'm interested in
Create a Send web request that
The request URL is `https://<yoursite>.atlassian.net/wiki/api/v2/pages`
Method is: POST
Custom content:
{
"spaceId": "<id of page space here - get from the key",
"status": "current",
"title": "Your page title {{now.jqlDateTime}}",
"parentId": "<id of the parent page>",
"body": {
"representation": "storage",
"value": "{{#lookupIssues}}{{key}} {{summary.htmlEncode}}<\/strong>\n{{#if(comments.size.eq(0))}}Issue has no comments<\/span>{{/}}{{#if(comments.size.gt(0))}}{{#if(now.minusDays(14).isAfter(comments.last.created))}}No comment in the last 14 days<\/span>\n{{/}}Last comment @ {{comments.last.created.jiraDate}}\n{{comments.last.body.htmlEncode}}{{/}}\n\n{{/lookupIssues}}"
}
}
Get the space id via
https://YOURURL.atlassian.net/wiki/rest/api/space/<space_key_of_parent_page>
The use an Authorization header with the value:
Basic base64(youremail:your_api_token)
To get a token and generate a base64 encoding
Generate a token viahttps://id.atlassian.com/manage-profile/security/api-tokens
echo -n your_email:your_token | base64
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.