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,293,823
Community Members
 
Community Events
165
Community Groups

JMWE Validator create Issuetype by Project Area Role

Hi, Guys,

Im need to create validator for Role who can create specific workflow used JMWE, since jira don't have creator setting for specific issuetype

I try create Build-your-own (scripted) Validator
I Look in Global variable : user.getProjectRoles(issue.project)

but I dont know how to use it.
Can you how to create validator for issuetype "task" can created by user role "IT Project Manager"?

1 comment

Hi @Tyas Iglecias ,

Add the below Jira Expression in "Build-your-own (scripted) Validator (JMWE app)", which returns true for Task issue type, only if the user is in the "IT Project Manager" role of that project (and returns true for issue types other than Task, irrespective of the user's role) : 

(!!issue.issueType && issue.issueType.name != "Task") || user.getProjectRoles(issue.project).some(pr => pr.name == "IT Project Manager")

 Hope this helps!

Regards,

Suprija

Like Tyas Iglecias likes this

Hi @Suprija Sirikonda _Appfire_ 

Thanks for information, it works

I have another question,

how to set validation, Task can created by user role and automate by JMWE? 
cause I not found JMWE as user/role/group

image.png

and what i know, Task can't create automate if we just set validation as role "Project Manager"


Regards,
Tyas
 

Hi @Tyas Iglecias ,

Modify the Jira Expression to below, which also checks the accountId of the user.

(!!issue.issueType && issue.issueType.name != "Task") || user.getProjectRoles(issue.project).some(pr => pr.name == "IT Project Manager") || user.accountId == "xxxxx"

Replace xxxxx with the accountId of the JMWE add-on user.

To insert the accountId of any user, select "Lookup user", search for the desired user and click on "Insert accountId".

 

Lookup user.png

 

 

Hope this helps!

Regards,

Suprija

Like Tyas Iglecias likes this

Hi @Suprija Sirikonda _Appfire_ ,


Thank you so much, it's work


Regards,
Tyas

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,135 views 34 44
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you