Hi all
I'm over my head with this ask, that I got last week. Quite specific:
- Every Friday run a JQL query to list up open "Blockers" (scheduled automation rule can do that)
- For each issue, extract the key, Assignee, and Summary
- Send a single Slack message to a shared channel with these 3 fields (1 line per issue) and also tag the Assignee in that line
I've messed around with {{lookupIssues}} but not found a way to format it. Let alone match the Atlassian user ID with Slack user ID...
The Slack message should look something like:
===
Outstanding blockers:
ABC-100 Jane Doe (Slack tagged) Improve the existing API
ABC-101 John Doe (Slack tagged) Finish the new brochure
===
Any ideas?
Takk,
KGM
There are two parts to this one: the Slack user ID and the issue field listing.
How many users do you have for Jira and Slack to map to one another?
That second approach is better for the next step: listing the fields. The reason is when iterating over the data in the Lookup Issues result, outside data is not visible. And if the Slack ID is already present for the Assignee data, they can easily be mentioned.
I'm not using Slack a lot currently, so I recommend looking at the necessary formatting in their information. Perhaps something like this:
{{#lookupIssues}}
* {{key}} - {{summary}} assigned to {{assignee.displayName}} <@{{assignee.properties.metadata.slack_id}}>
{{/}}
Kind regards,
Bill
Takk, @Bill Sheboy ! Love it! I didn't know how to list them up with more than just the issue key.
I think we might only have a few users so I'll look into the Lookup Table
Thanks a million!
KGM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I am not able to access the "Value" in the table (and as you can see in the pictures, I've simplified the value and the Slack message to try to troubleshoot).
What am I doing wrong, @Bill Sheboy ?
Takk, KGM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can access the table with
{{nafn.entries}}
and print the results in the Slack message but somehow it doesn't work in the loop/iteration.
Takk again, KGM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My apologies I was not more clear in my original post! Here is more context to help...
Once inside an iterator (e.g., {{#lookupIssues}} ... {{/}} ) only data from the lookup results and lower in scope is visible. And so the table is not visible.
The lookup table approach works for a single issue. To iterate over the lookup issues the two possible techniques are:
To do the entity property method without a lot of hassle you may use a tool to add entity properties or use 2 rules. Let's go over the 2-rule approach:
{{#lookupIssues}}
* {{key}} - {{summary}} assigned to {{assignee.displayName}} <@{{assignee.properties.metadata.slack_id}}>
{{/}}
When new people / users are added, the first rule may be updated, run again to refresh the entity properties, and then disabled.
UPDATED: I changed the entity property attributes to better align with that earlier article from Atlassian: https://community.atlassian.com/t5/Automation-articles/Mention-someone-directly-in-Slack-via-Jira-Automation/ba-p/1528605
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much, @Bill Sheboy for clarifying. Makes sense now, after all my testing yesterday and not getting any value from the table. I had concluded that this code wasn't getting the value from the table at all.
So you are suggesting that the "extra" rule add a new attribute/property to our Atlassian user profile called "slack_id" and populate that. This attribute is then accessible within the iterator loop {{#lookupIssues}} ... {{/}} yes?
Takk, KGM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that is correct.
That first rule takes the place of the bulk-loading suggested in the article by @Daniel Eads and would work for a smaller number of users (although requires manually entering values in the table).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you again, @Bill Sheboy for all your help. If I may ask, does the field/property:
slack_id
exist already on the Atlassian user profile or do we have to create it somehow?
Takk, KGM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not believe it exists by default, and I just did a quick test with my free-license site to confirm that. You may do the same by:
And...we are adding the entity property under the metadata one to reduce the risks of collision and keep things nicely organized. For example, if other properties were added for the user by the customer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you again, @Bill Sheboy , for all your help! I ended up using an Automation rule to populate my zslackid property on the Atlassian users:
Have a great day! KGM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or you, brother @Darryl Lee ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Bill Sheboy Any ideas?
Takk, KGM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.