Hello community.
I need your collaboration to be able to set up the following automation:
- Trigger: Schedule (daily)
- Action: Lookup issues
- Then: Send a slack msg
The conditional would be that depending on the search result returned by the "Lookup Issues" action, if it is greater than "0" it should send a Slack msg and if it is equal to "0" it should send another type of msg in Slack.
JQL CODE:
created >= -2d AND updated <= -24h AND status in ("B2CLOUD INVESTIGATING", PENDING, "WAITING FOR SUPPORT")
What is the component I should choose for this to work as desired? FOR EACH Block or IF Block?
You can use an IF condition for this with an IF, ELSE block. Here is a small example:
Hope this helps.
Adding to this...
The above example is not quite correct. The smart value that needs to be used is {{lookupIssues.size}}, not just simply {{lookupIssues}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy ClaspillMy example works (I tested it), probably because the lookupIssues object is not even there if the lookup returns no results. But yes, your solution is certainly more elegant. Thank you for the addition!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys @Michel Neeser @Trudy Claspill , thanks a lot for your help!!!
That helped me a lot.
Now I have the following question, because in the message that I want to send from SLACK it takes the last comment made in the incident, what I need is to place a conditional through the smart values that allows me to "not take the comments made by a user in particular (Automation for Jira)", is this possible?
I understand that I should specify the user ID, but I don't know what the correct statement is to carry out this action.
This is my code in the slack message:
{{#lookupIssues}}
<https://b2c.atlassian.net/browse/{{key}}|{{key}} > {{summary}}>
{{assignee.displayName}}
{{comments.last.body}}
{{comments.last.author.displayName}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dario AlarcónYou can loop through the comments of an issue and check for a specific user (e.g. Automation for Jira) like this:
{{#lookupIssues}}
{{#comments}}
{{#if(not(author.accountId.equals("xxxxxx:xxxxxx")))}}
Comment NOT from Jira Automation: {{body}}
{{/}}
{{/}}
{{/}}
However, I am not sure how to only output the LAST comment which is not from Jira Automation. Maybe someone else has an idea?
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.