Hello, everybody!
I have created following automation that sends message containing Jira Issue keys and Issue summary to Slack:
1. As a trigger I have incoming webhook with a list of Jira Issue Keys.
2. Then I create a variable from {{webhookData.issues}}
3. After that there is lookup over {{webhookData.issues}}
4. Then sending following message to slack:
Time: {{webhookData.timestamp}}
Issues included in this release:
{{#lookupIssues}}
* {{key}} {{summary}}
{{/}}
5. After that some transition of the issues.
Here example of what my API call looks like:
curl -X POST -H 'Content-type: application/json' --data '{"issues":["BDO-391","BDO-392"], "data": {"issues":["BDO-391","BDO-392"], "timestamp":"13:30"}}' https://automation.atlassian.com/pro/hooks/<my-webhook>
Here a duplicated messages in Slack for each Jira Issue:
Thanks in advance for your help!
Hi @Davyd Derkach -- Welcome to the Atlassian Community!
The rule's trigger is using the option "Issues provided in the webhook HTTP POST body", and so the steps loop over each issue provided.
You could change your rule to instead use the option "No issues from the webhook" and pass only the issue keys in the custom data. Then you could control how the rule handles them.
For example, the data from the sending application could be passed as:
{ "data": { "keys": "BDO-392,BDO-391" } }
And then the JQL to access the issues in your rule would be:
key IN ( {{webhookData.keys}} )
Kind regards,
Bill
Hello, Bill!
Thanks a lot for quick response.
Your suggestion of using key IN ( {{webhookData.keys}} ) helped to not receive couple messages in Slack. For now I receive only one as expected.
However the branch part, in which I check for issue status and then perform a transition is not working with this setup:
In Rule "Issue fields condition" the warning appeared with following details:
In "Advanced branching" i use smart value {{webhookData.keys}} in for each (visible on first screenshot).
The API call that I sent:
curl -X POST -H 'Content-type: application/json' --data '{"data": {"keys": "BDO-392,BDO-391"}}' https://automation.atlassian.com/pro/hooks/<my-webhook>
----
Thanks in advance and sorry for my sometimes lazy questions since it`s my first task related to Jira automation(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could replace the advanced branch with a branch on JQL with the same JQL I provided for the Lookup Issues action. That will enable iterating over the issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank again @Bill Sheboy
It`s helped me to receive only one message in Slack and to transition issues correctly.
Here is final look of my automation for others, who may face same issues:
The API call that I execute, looks like this:
curl -X POST -H 'Content-type: application/json' --data '{"data": {"keys": "BDO-392,BDO-391"}}' https://automation.atlassian.com/pro/hooks/<your-webhook>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello again, @Bill Sheboy
I have one more question and maybe you can help me with it?
Currently after each pipeline run I a script which use a webhook API call to sent Jira Issue keys that related to current release to my Jira Automation:
curl -X POST -H 'Content-type: application/json' --data '{"data": {"keys": "BDO-392,BDO-391"}}' https://automation.atlassian.com/pro/hooks/<your-webhook>
Also, I need to sent another information like release tag version, release date etc. and later this will be sent to Slack with my Jira Automation above.
So I am wondering is there a way not to use script with API call to sent Jira Issue keys and another information? I saw in documentation something about smart values like: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-development/
But I cant find information whether these smart values will be available in case I am not send them via Webhook URL but just reference them into automation. I have GitLab integration with my Jira.
Also maybe you know smart values that can help me to retrieve Jira issue keys that related to current release tag, Release Engineer name, date of pipeline run and Jira issue summary?
Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In general, most of the automation smart values apply when an issue is available to the rule.
For an incoming webhook from Jira itself, it is possible to send the issue content. But your source for the webhook is different.
Using some of the data you reference, you would likely need to use your source control / release management tool to find the relevant issues' keys and then look them up with JQL once inside the automation rule.
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.