Condition is not working

Manoj June 12, 2023

Hello Community.

kindly guide, i am using post function to "comment on issue" and have a below condition

issue.get("issuetype")?.name == "Demand"&&issue.get("priority")?.name == "3-Major"||issue.get("priority")?.name == "4-Minor"||issue.get("priority")?.name == "5-Trivial"

this is working fine but apart from the issueType Demand, we have issueType user story and this condition works for user story too but this should not happen. we dont want to trigger the condition for user story.

any guidance will help to restrict this.

1 answer

1 accepted

0 votes
Answer accepted
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2023

Hi @Manoj ,

have you tried to use round brackets?

issue.get("issuetype")?.name == "Demand" && (issue.get("priority")?.name == "3-Major" || issue.get("priority")?.name == "4-Minor" || issue.get("priority")?.name == "5-Trivial")
Manoj June 12, 2023

@Hana Kučerová  Hello, yes i did but got the error below:

Error :

This page can't be displayed. Contact support for additional information.

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2023

Hm, strange... What about

issue.get("issuetype")?.name == "Demand" && issue.get("priority")?.name in ["3-Major", "4-Minor", "5-Trivial"]

Thank you. 

Manoj June 12, 2023

@Hana Kučerová Well, this is working indeed. 

Like Hana Kučerová likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events