Introducing Jira Expressions

Hi @VitaliyUshanov,

There is no REST API to edit issues in bulk. But we have an API to edit an issue property in bulk (for multiple issues at once), and you can define the property value with a Jira expression: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-properties/#api-rest-api-2-issue-properties-propertykey-put. Perhaps you could use an issue property instead of a field in your app to benefit from it?

1 Like

Hi @kkercz,

our app has a feature that allows the user to update Jira issue fields, in some cases in bulk. We hoped to reduce the number of requests to Jira by utilizing some bulk update method. It looks like Jira expressions could provide a way to do just that, like with issue properties.

Hi What is the best way to check a value is in a list?
match
issue.status.name.match(‘^(Closed|Rejected)$’) != null
or an includes
[‘Closed’, ‘Rejected’].includes(issue.status.name)

Hi, @listertuk,

Both will work fine, so it’s a matter of personal preference.

To me, the version with includes is cleaner. It’s easier to use if the list of values isn’t hard-coded in the expression, but loaded dynamically. And it can be modified to just return false if any of the variables along the way is null:

[‘Closed’, ‘Rejected’].includes(issue?.status?.name)
1 Like

Hi @kkercz

Can we use Jira expressions for Assets Object custom fields?

Hey @VMK,

there is no out-of-the-box support for Assets, but if they are custom fields from the Jira API perspective, then you can work with them like with any other custom field, see https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference/#issue

all custom fields are available and can be referenced by one of the following:

  • ID: issue.customfield_10010
  • key: issue['com.my.app.field-key']

Custom fields are returned as JSON values, in the same format as in the Get issue REST API.

Hi! I am a bit new to using JIRA Expressions but would it be possible to use this so that a custom field only becomes mandatory if another field, the checkbox is clicked and is “Yes”?

So essentially we have a “Field required validator” on field B, add an error message but also have a Conditional validation based on what was picked in field A?