Hi All,
How to use user not in a group condition in post function.
Can someone help me with the snippet for Jira Cloud. We use both JMWE and Scriptrunner
TIA!!
Hi,
what do you mean by "condition in post function"? Are you trying to create a conditional execution script for a JMWE post-function? Or are you trying to create a workflow condition (not post-function)?
Thank you for your reply. I'm trying conditional execution script for a JMWE post-function.
Condition should be like this "user not in a particular group"
If a user not in a group X then set the default value to the sprint field and to a custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this:
{{not currentUser | isInGroup("administrators")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @David Fischer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello do you mind giving the full example?
This line only returns 'true' result ;-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That line will return false if the currentUser (you if you are "testing" the expression) is not in the "administrators" group. I just tested it and it works.
Where are you trying to use it? In a JMWE post-function's Conditional Execution section?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dan H ,
Conditions and Validators don't use Nunjucks but Atlassian's Jira Expressions language (it's a limitation of Jira Cloud). The correct syntax in Jira Expressions is:
!user.groups.includes("administrators")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.