Hi,
How can I make a field mandatory, but only when users create the issue manually. I want to keep the fields open if there is an automated creation (e.g. through API or jira automation).
Thanks a lot!
It can be implemented via Jira expression based validators. Such validators are available via apps, such as:
Jira Misc Workflow Extensions (JMWE)
Workflow Conditions, Validators & Web Assembly Postfunctions
The last one is free, but I didn't test it.
The expression will look like
user.accountId == '<automation_account_id>' || customfield_XXXXX != null
Try using a validator that checks for a value in the field during the transition. Create a separate transition without the validator which is only available to the automation users.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One approach we use is for the field to not be mandatory, but have conditions in the workflow first transition based on the user or user group creating the ticket. If condition is not fulfilled, creation fails with a message. One caveat: we use Jira Misc Workflow Extensions (JMWE) add-on for this due to more options vs. Jira's oob conditions...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is an example (using JMWE) where we make some fields as mandatory during creation time if the ticket creator is _not_ a JSM portal user:
The following fields must not be empty: Product, Organizations, Severity
The following message will be displayed if validation fails: The following fields are Mandatory: "Product", "Organizations", "Severity"
Validate only issues that satisfy the following Jira expression:
user.getProjectRoles(issue.project).some(pr => pr.name != "Service Desk Customers")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Become an effective Jira admin
Manage global settings and shared configurations called schemes to achieve goals more quickly.
Streamline Jira administration with effective governance
Improve how you administer and maintain Jira and minimize clutter for users and administrators.
Learning Path
Become an effective Jira software project admin
Set up software projects and configure tools and agile boards to meet your team's needs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.