How to include the cloned issue key on Slack notifications?

I would like to know if it is feasible to include both the created issue's key and the key for the cloned issue (created via automation) in the slack notification.

I have the following automation pattern in place:

1. The rule is global

2. The automation runs when an issue is created.

3. I use JQL to limit the projects the automation may run against.

4. I add some labels to the new issue.

5. I clone the ticket into a central project for the development team.

6. I send a slack notification indicating the issue has been created.

Here is what I have tried thus far, without success:

Trigger Issue
Trigger Issue: {{triggerIssue}} - returns the trigger issue key as expected
Trigger Issue Key: {{triggerIssue.issuekey}} - returns nothing
Trigger Issue Key: {{triggerIssue.key}} - returns the trigger issue key as expected
Trigger Issue Requester: {{triggerIssue.reporter}} - returns the requester

Cloned Issue
Issue Key: {{issue.key}} - Returns the trigger issue key - I want the cloned issue key.
Issue Key 2: {{issuekey}} - returns nothing
Issue Summary: {{issue.summary}} - returns the issue summary (trigger issue)
Issue Description: {{issue.fields.description}} - returns the trigger issue description
Issue Links: {{issue.fields.links}} -- returns nothing
Issue fields: {{issue.fields}} -- returns a collection {}, I think...

I want something like this in Slack:

{{triggerIssue.issuekey}} - {{triggerIssue.summary}} has been cloned to the Developer project. The cloned Developer ticket is {{issue.key}}.

Which should read something like the following in Slack:

BUS-784 - A sample summary has been cloned to the Developer project.  The cloned Developer ticket is DEV-943.

Is it possible to access these fields, and if so, how should I approach this?

2 answers

 {{#createdIssues}}{{key}}{{/}} is what I was looking to find.  It is in the documentation.  I missed it...



 {{#createdIssues}}{{key}}{{/}} is the syntax I was looking to find.  It is clearly spelled out in the documentation and I missed it...

I hope this may helps someone else.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Marketplace Apps

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,155 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you