JMWE event based actions to set a field base on user

Rosana Casilli June 2, 2022

Good morning!!

 

I am trying to create an event base using JMWE to set a field in jira only if the reporter is not in a Group  (o could be role also) 

 

I found the IsInRole/ IsinGroup function but it is not what I want to compare.

Can anybody help me please?

 

Thanks in advance

Ro

1 answer

1 vote
David Fischer
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 2, 2022

Hi @Rosana Casilli ,

I'm not sure I understand your requirements. Why are the isInRole / isInGroup filters not what you need? Can you please describe your need in more details?

Rosana Casilli June 2, 2022

Hi @David Fischer I want to check that the user is not in a particular role, or is not in a particular group but the function evaluate that "isinrole" or "isingroup" 

 

for example:

user creates an issue 

if the user does not have the role "X" then set field label with a value "XX"

David Fischer
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 2, 2022

Got it. Then what you're looking for is:

{{ not ( currentUser | isInGroup("administrators") ) }}
Alex Koxaras _Relational_
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 2, 2022

and I would extend the above code to something like:

{{ not (currentUser | isInRole ( "Administrators")) and not (currentUser | isInGroup ( "Administrators"))}}
Rosana Casilli June 2, 2022

Thank you both!!

I tested this expression 

{{ not ( issue.fields.reporter | isInRole("QA Team") ) }} but it returns always true not matter if  the reporter has that role or not... 

David Fischer
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 2, 2022

The isInRole filter also needs to know in which project to check the role membership - check the online help for it in the Nunjucks filters help tab

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events