How to include the cloned issue key on Slack notifications?

Justin Andrews September 18, 2017

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

1 vote
Justin Andrews September 18, 2017

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



0 votes
Justin Andrews September 18, 2017

 {{#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
TAGS
AUG Leaders

Atlassian Community Events