Message format for assignee (Jira>Slack integration)

Daria Pavlova May 5, 2023

Dear community!

Please help to figure out. I am trying to sent message from jira to my channel with overdue tickets and I'd like to reflect assignee name in it

I tried 

{{#lookupIssues}}
*<{{url}}|{{key}}|{{assignee}}>
{{/}}

but it sends assignee code instead of name

I also tried

{{assignee.displayName}}

but it brings the error

Any ways to reflect assignee name here?

Thanks in advance for your answers!

2 answers

1 accepted

0 votes
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 5, 2023

Howdy @Daria Pavlova ,

Looks like there's a couple things going on here. You've got a lookup list, are trying to generate a URL using Slack syntax, and use a smart value for the assignee. Based on these factors, I think this matches your intent:

{{#lookupIssues}}
*<{{url}}|{{key}} - {{Summary}}>: {{assignee.displayName}}
{{/}}

This should output something that looks like this:

CONFSERVER-2358 - Rename "blog post" to "News": Daniel Eads

 

The error you saw was that the Slack URL patterns are "<<link|text>>" - the extra "|" character between key and assignee in your example was throwing it for a loop. If you want the name hyperlinked as well, just include it without the extra bar - here's a working version of your first example:

{{#lookupIssues}}
*<{{url}}|{{key}} {{assignee.displayName}}>>
{{/}}

which would look like:

CONFSERVER-2358 Daniel Eads

 

Cheers,
Daniel

Daria Pavlova May 5, 2023

Thank you Daniel, it works perfectly!

You're amazing! 

1 vote
Ken McClean
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2023

Is this a ScriptRunner script? If so, you'd reference the assignee with something like $issue.assignee 

Suggest an answer

Log in or Sign up to answer