Hi, I have a working automation that does the following:
I noticed on the release page however, I can add "related work" to this release.
I want to update my automation to link the Confluence page so that it displays as "related work" on this trigger release. Is this possible to do?
Thanks!
Hi @Luke Abel
I do not think there is a OOTB Automation action today that lets you `Add Related Work` to the release.
You can probably log a feature request for the same here
Alternatively If you can find a Jira REST API that lets you do this, then we can probably use the `Send Web Request` action after you create the confluence page to do this linking but I do not know if such a public API exists today.
Cheers,
Agraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do you have an example Rest API request?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to get as far as linking a URL but not a Jira Work Item (Issue).
You can achieve this using Jira's REST API through automation. Here's the approach:
Setup:
1. Create a [service account](https://support.atlassian.com/user-management/docs/understand-service-accounts/) (Standard tier+) to ensure automations persist when team members leave
2. Get your [cloud ID](https://support.atlassian.com/jira/kb/retrieve-my-atlassian-sites-cloud-id/)
3. Add the service account to relevant projects
API Call (REST):
Use the "Send web request" action in automation with:
curl -X POST \
"https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/version/{versionId}/relatedwork" \
-H "Content-Type: application/json" \
-u "serviceaccount@company.com:API_TOKEN" \
-d '{
"category": "Test",
"title": "Regression Cycle",
"url": "{{someURL}}"
}'
GraphQL Alternative:
I was able to achieve this with GraphQL as well:
curl -X POST \
"https://api.atlassian.com/graphql" \
-H "Content-Type: application/json" \
-H "X-ExperimentalApi: AddRelatedWorkToVersion" \
-u "serviceaccount@company.com:API_TOKEN" \
-d '{"operationName": "addRelatedWorkMutation", "query": "mutation addRelatedWorkMutation { jira { addRelatedWorkToVersion(input: {versionId: \"ari:cloud:jira:{cloudId}:version/activation/{versionAri}\", relatedWorkId: \"{workId}\", url: \"{{baseUrl}}/browse/{{issue.key}}\", title: \"{{issue.summary}}\", category: \"Development\"}) { success errors { message } } } }"}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure when this particular one was release, but there is this... https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-version-id-relatedwork-post
Unfortunately, this does not seem to acutally LINK the issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.