How can I list a linked issue's URL in a Slack automated message from the parent issue project?

Nathan Yam
Contributor
November 19, 2024

I have 2 projects, Project 1 (ABC) and Project 2 (XYZ). Project 1 is a service desk project to receive tickets, but the team actually do the work in Project 2 (their software project).

For each issue created in Project 1 (e.g. ABC-001), I have an automation rule to clone the issue into Project 2 (e.g. XYZ-002) and link the 2 issues such that "ABC-001 is delivered by XYZ-002". 

Since the SLA tracking is done in Project 1 (ABC), any SLA triggered Slack messages need to come from Project 1. So if say ABC-001 is close to breaching a particular SLA and I wish to alert the team with a message that includes the URL of the linked issue (i.e. XYZ-002) instead of ABC-001, what is the smart value I should use?

 

1 answer

1 accepted

0 votes
Answer accepted
Chander Inguva
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 21, 2024

To include the URL of the linked issue (i.e., the issue in Project 2, XYZ-002) in the SLA alert message, you can use Jira automation smart values effectively. Here's how you can achieve this:

  1. Identify the Linked Issue: Use the smart value to reference the linked issue based on the issue link created during the cloning process.

  2. Access the URL of the Linked Issue: Use the {{issue.issuelinks}} smart value to fetch details of the linked issue, and specifically the key of the issue in Project 2.

Smart Value for the URL of the Linked Issue

Assuming the link type is "is delivered by" (as mentioned), you can use the following smart value to extract the linked issue's key and form its URL:

{{issue.issuelinks.first.outwardIssue.key}}

 

You can then construct the URL by combining your Jira base URL and the issue key:

https://<your-jira-domain>.atlassian.net/browse/{{issue.issuelinks.first.outwardIssue.key}}

 

Slack Message

⚠️ SLA alert for {{issue.key}}! This issue is approaching its SLA breach. 
Work is being tracked in the linked issue: [{{issue.issuelinks.first.outwardIssue.key}}](https://<your-jira-domain>.atlassian.net/browse/{{issue.issuelinks.first.outwardIssue.key}})

 

Nathan Yam
Contributor
November 22, 2024

Hi @Chander Inguva thanks for the response. I tried it out but the Slack message that got sent out only displayed (below)

https://<your-jira-domain>.atlassian.net/browse/

The smart value portions were empty so I'm guessing I have to change the scope to Global. 

Chander Inguva
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2024

@Nathan Yam Did you try to log the above in automation rule before sending to slack for troubleshooting so we know smart value is working as expected?

Nathan Yam
Contributor
November 22, 2024

@Chander Inguva do you mean to create another rule to test out the smart value first?

Chander Inguva
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 22, 2024

Yes please

 

Nathan Yam
Contributor
November 25, 2024

Hi @Chander Inguva 

I happen to test out the smart value {{issue.issueLinks.inwardIssue}} via log action together with {{#debug}}, and it returns the linked issue key in the audit log. 

I then changed the log message to 

{{#debug}}https://<jira-domain>.atlassian.net/browse/{{issue.issuelinks.inwardIssue}}{{/}} 

and it returns the URL with the issue key in the audit log. 

However, when I paste 

https://<jira-domain>.atlassian.net/browse/{{issue.issuelinks.inwardIssue}}

into the Slack automation rule, the smart value is not empty. So it seems like the problem isn't with the smart value but the automation rule. I wonder if I have to change the rule scope to global.  

Nathan Yam
Contributor
November 25, 2024

@Chander Inguva I finally resolved it. I happen to decide to put the Re-fetch issue data action before the Add: Send Slack message action and that did the trick. Thank you so much! 

Chander Inguva
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 25, 2024

Awesome Nathan, sorry did not get chance to look back at latest updates from this. Glad it worked for you

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events