Hello-
I have opening up one of my projects to the public . JIRA cloud; software project
There are some fields that are mandatory for internal users when creating tickets.
However for external users , is there a way to make those fields optional when they are creating issues?
To provide expand a bit on what Joe wrote, you'll need to use Jira Expressions from a third-party add-on to set up a Workflow Validator based on probably User Role or Group:
One example is here:
Unfortunately internal users won't be able to see the field is mandatory (with the little red asterisk) unless they try Submitting it, and get the warning message. The workaround is to add a field description explaining that it's mandatory for internal users but not external.
(I wouldn't say Jira Expressions are "scripting", exactly. They're unfortunately a little more confusing, at least to me. :-)
I wrote a whole article about them:
https://community.atlassian.com/t5/Jira-articles/Jira-Expressions-But-Why/ba-p/1694545
Hey Darryl, I came across this thread when searching for a walkthrough for a similar situation.
I want to make a validation when an issue is created - when the creator is of a certain group, to make one custom field mandatory.
I get stuck in the part when making the field mandatory. Can't get my head around how the property or function should be called and if this is even possible.
issue.creator.groups.includes('new-group')? issue.customfield_12345 (<- what to add here?)
Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So first off, you will need a third-party app that allows you to set up a custom Workflow Validator.
For example, JMWE includes a Field Required Validator which you would need go add to your Create transition. That's where you would add:
user.groups.includes("yourgroup")
Similarly, you could use a ScriptRunner Script Validator or JWT Jira expression validator or Cloud Workflows Custom Jira Expression to do this, but that would be something like:
!user.groups.includes("yourgroup") || issue.customfield_12345 != ""
So that means that either of these things must be true:
OR
Well, I think that's right. It's been a while since I've worked on Expressions. Maybe @David Fischer or @Oliver Siebenmarck _Polymetis Apps_ could check my work?
I think an alternative if your customfield is not a string or number field would be to use !!issue.customfield_12345? But that whole double-exclamation thing still confuses me a bit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Tenzing Doleck and thank you @Darryl Lee for mentioning us!
Yes, a Jira expression validator could evaluate if a user belongs to a group and if it does, enable a transition. If you are interested in evaluating different sets of users, it might be worth taking a look at the use case Evaluate the user from our documentation.
In this case, it would also be necessary to evaluate the content of the custom field, which is not a problem if you are using the Jira expression validator! The expression for that purpose would look like this:
user.groups.includes("yourgroup") ? issue?.customfield_10001 != null : true
First, it would evaluate if the user is a given group and then, if it does, it would evaluate if the designated custom field has a value. Otherwise, the expression would return true, that is, it would pass if the user does not belong to said group.
Please, be aware that the expression may vary slightly depending on the type of custom field.
If you want to learn more about the different possible applications of the Jira expression validator you can visit Jira expression condition/validator (use cases).
I am part of the Support Team for JWT for Cloud. Please, do not hesitate to contact us if you have any doubt about JWT through our Support Service Desk.
Best regards,
Vicente
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Darryl Lee and @Vicente Domínguez _Decadis AG_ , thank you both for the swift and informative replies!
I'm currently using Cloud Workflows, and all of this is new to me, so sorry if I'm not able to articulate my thoughts the best way possible.
The solution that @Vicente Domínguez _Decadis AG_ proposed looks like it will do the work, this is a clever way to enforce the user to put a value. I tried it with myself and it seems to work! Thank you very much, Vicente!
I was just expecting some other way to make this happen, something like
issue.customfield_128272.isMandatory == true :D
Well, my issue is resolved, thank you again to both of you!
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If they're set in the field configuration, no. You would need scripting to make them required for internal users while leaving them not required in the field configuration.
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.