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!
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...
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")
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
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Improve user experience across Jira with global settings
Learn how to set up and configure a Jira site, manage Jira permissions, and configure Jira apps and integrations.
Learning Path
Streamline projects across Jira with shared configurations
Build Jira work items with reusable configurations called schemes, and reduce administrative work with automation.
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.