Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,485
Community Members
 
Community Events
184
Community Groups

Automation - multiple if condition in lookupissue

Andrii Mykhailytsia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 25, 2023

Hi, 

Are there a way to use multiple if conditions inside one lookupissue block?

I want to have priority as a slack emoji so I tried this:

{{#lookupIssues}}
<{{url}}|{{key}}> {{#if (equals issue.priority.name, "P0 - Blocker")}}:p-blocker: {{/}}{{#if (equals issue.priority.name, "P1 - Critical")}}:p-critical:{{/}}{{#if (equals issue.priority.name, "P2 - Major")}} :p-major:{{/}}{{#if (equals issue.priority.name, "P3 - Minor")}}:p-minor:{{/}} {{assignee.displayName}}: {{summary}}
{{/}}

But it doesn't work, priority is missing in a message.

Are there any way to do this?

2 answers

1 accepted

1 vote
Answer accepted
Bill Sheboy
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 25, 2023

Hi @Andrii Mykhailytsia -- Welcome to the Atlassian Community!

I see two problems in your expression:

  1. Inside of a Lookup Issues iterator, you use an {{issue. prefix for the fields, but that is not needed as the fields are part of the lookup instead.  Try removing those.
  2. Your calls to the equals() function were missing their parentheses.

Perhaps try this one:

{{#lookupIssues}}
<{{url}}|{{key}}> {{#if(equals(priority.name,"P0 - Blocker"))}}:p-blocker: {{/}}{{#if(equals(priority.name,"P1 - Critical"))}}:p-critical:{{/}}{{#if(equals(priority.name,"P2 - Major"))}}:p-major:{{/}}{{#if(equals(priority.name,"P3 - Minor"))}}:p-minor:{{/}} {{assignee.displayName}}: {{summary}}
{{/}}

I may have adjusted your spacing, so please fix that as needed.

By the way...you might also try the new Lookup Table feature to do this without conditional logic: https://community.atlassian.com/t5/Automation-articles/New-Automation-action-Create-lookup-table/ba-p/2311333

Kind regards,
Bill

Andrii Mykhailytsia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 26, 2023

@Bill Sheboy it works, many thanks!

0 votes
Dan Breyen
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 25, 2023

Hi @Andrii Mykhailytsia welcome to the Community!  YES, I have one Automation that takes the User submitted Impact and Urgency in JSM and transforms it into a Priority.  It's checking 4 different Urgency values against 4 different Impact values.  Granted some of the values are the same but it starts with IF... and then continues with 10 different ELSE IF statements.  Support helped me out with it, but we got it to work. I would try it out in an Automation, there are even some KBs out there to help out.  If you need assistance, I'd give Support a shout.

Suggest an answer

Log in or Sign up to answer