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
Jira Administrator
Configure Jira Software, Jira Core, or Jira Service Management, including global settings, permissions, and schemes.
Managing Jira Projects Cloud
Learn to create and configure company-managed projects in Jira Software and partner effectively with Jira Admins.
Learning Path
Become an effective Jira Software Project Admin
This learning path is designed for team leaders who configure Jira Software projects to match a team's processes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.