Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Log Work field mandatory based on group

siva
Contributor
March 8, 2022

Hello,

I need some help when issue moving from open to in progress status and I need Log Work system field mandatory based on specific group members. And I added this Log Work field in transition screen and i want to make this field mandatory based on specific group members only. Please help me how to achieve this issue.

Note: we are using script runner, JSU,JMWE and JWT apps in my jira instance.

 

Thanks in advance,

Siva

3 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
March 8, 2022

Hi @siva 

you can use JMWE's Field Required Validator, and for the Conditional Validation use this script:

currentUser.isInGroup("some-group")
siva
Contributor
March 8, 2022

Hi @David Fischer 

Thanks for the reply and I used JMWE's Field Required Validator and used script what you mention in above comment and it working perfect.

The present script works only on single group is there any possibility to set multiple groups in the script. Once again thanks for your help very appreciated.

David Fischer
Community Champion
March 9, 2022

Sure. If you want to test whether the current user is in one of several groups, use something like this

currentUser.isInGroup("some-group") || currentUser.isInGroup("other-group") || currentUser.isInGroup("yet-another-group")

And if you want to test if the current user belongs to all of several groups, use something like this

currentUser.isInGroup("some-group") && currentUser.isInGroup("other-group") && currentUser.isInGroup("yet-another-group")

 

siva
Contributor
March 10, 2022

@David Fischer 

Thanks for the early reply that really worked for me.

 

Thanks,

Siva.

2 votes
Frank Leclerc _Decadis AG_
Contributor
March 8, 2022

Hi @siva ,

only for the reason of completeness here also the way with JWT:

You can solve the condition via a logical condition with the isInGroup expression:

isInGroup(%{system.currentUser},"jira-administrators")

And analogous to JMWE you can use a Field required validator to make the field for the transition mandatory.

Furthermore, you will find in the UseCase library many more examples for the application of JWT in workflows, overall automation, and calculated custom fields.

For further questions about JWT, you can always contact our support.

Cheers,
Frank

0 votes
Mark Segall
Community Champion
March 8, 2022

Hi @siva - Try this...

  • Set the field as required in your field configuration
  • On the transition you've already created, add a condition that it is only available to the group in question
  • Create a second transition
    • No transition screen
    • Condition that it is NOT available to the group in question

Suggest an answer

Log in or Sign up to answer