Hello -
New to ScriptRunner, so bare with me!
Problem: I want to implement "advanced" security that will restrict users from creating a ticket under certain factors..
Solution: I thought I may be able to use Workflow and ScriptRunner to implement this.
Implementation: In my workflow, I have the following:
Validator 2 is where I am "stuck" at and need some assistance. I've been looking at guides at what logic to write, but am having trouble piecing together Jira Expressions. None of the examples show if/else logic, so not sure if I can do that with these validators? Can anyone point me in the right direction?
Hi @Darron . How do you want to make Priority field optional? Is it your custom field?
But expression for user + group should be
user.groups.includes("Power User")
If you will clarify the priority "issue", we can complete it :)
Hi @Martin Bayer _MoroSystems_ s_r_o__
Priority is the out of the box field available from JIRA Cloud. It is already set up as optional (by default), and from my understanding that cannot be changed.
Is it possible to achieve what I am trying to do with the out of the box Priority field? Or do I need to use a custom field instead?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just tested it. The true is that Priority is not marked as optional but I can not fill in the blank option. Can you share your Create screen?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Therefore the factors change a bit...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Darron I think this Jira Expression should work:
(user.groups.includes("Power User") && issue.priority.name != 'Unprioritized') || issue.priority.name == 'Unprioritized'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Martin Bayer _MoroSystems_ s_r_o__ .
I tested this out and worked perfectly. With this as a baseline, I should be able to figure out anything else I need. Really appreciate your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're welcome :) Happy to help :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!
Help us plant more trees
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.