Set entity property value

A workflow post-function that sets the value of an entity property of the current issue, current issue's project or current user. The value can be provided either as text (with optional Nunjucks annotations) or as a JSON value.

When you add this post-function to a transition and trigger the transition, the add-on sets the specified entity property of the selected target (either the current issue, the current issue's project, or the current user) to the specified value. The value can be provided either as text (with optional Nunjucks annotations) or as a JSON value.

  • In the case of text, the value can be a simple string (for text typed fields), the string representation of a number, date or boolean value, or the string representation of a complex value, such as a Version name, a username, a Project key, etc. You can also use Nunjucks to insert dynamic values (issue, transition, or current user information). 

  • In the case of a JSON value, which requires the option Treat value as JSON (explained below), it can be a String, a Number, a Boolean or an Object. It can also be an array of such values.

To find out more about the type of value expected by this post-function for different field types, see Expected value for each field type.

To add 'Set entity property value' post-function to a transition : 

  1. Click Edit for the workflow that has the transition to which you wish to add the post function.

  2. In the Workflow Designer, select the transition.

  3. Click Post Functions in the properties panel.

  4. Click Add post function.

  5. Select Set Entity Property value from the list of post function.

  6. Click Add to navigate to the Set Entity Property value post-function screen where you can add configuration details. See below for more information.

  7. Click on Add to add the post function to the transition.

JMWE shows an error message on the issue view if any error occurs during the execution of the post-function. This message is displayed only if the current user is a Jira administrator. 

Entity and Property name

Select the entity for which the property should be set, the property name, and the value to use:

  • Entity

    • Current issue - Set a property of the current issue (the issue that triggered the post function).

    • Current issue’s project - Set a property on the current issue’s project.

    • Current user or Run as user - Set a property on the user who triggered the post function - either the current user (default) or the user set under Run as, below.

  • Property name - The name of the property to set.

  • Value - The value for the property.

Options

  • Treat value as JSON - Sets the property value to a JSON object or an array of objects. It will take the Value in the value template and parse it like a JSON string into a JavaScript object. This will be passed back to Jira as the value of the property. To learn about the JSON value expected by the post-function, see Expected value for each field type.

  • Set only if property is empty - Sets the value of the selected property only if the property is empty.

  • Ignore empty value - The post function will not set the selected property if the Nunjucks template that returns the Value is empty or null.

Advanced options

Expand this section to see advanced configurations including which user will run the post function, conditional execution, and delayed execution.

Run As

Conditional execution

Delayed execution

You are viewing the documentation for Jira Cloud.

 

Set Entity Property Value post function configuration screen
Figure 1 - Set Entity Property value post function

Â