Skip to end of banner
Go to start of banner

Update Any Issue Field Post Function

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 52 Next »

JSU for Jira Server/Data Center

This is the documentation of JSU for Jira Server/Data Center. If you are using JSU on Jira Cloud, see our JSU Cloud documentation.

Description

The Update Any Issue Field post function updates any field to a specified value after a transition has been completed. This can be a system- or a custom field. The field can be on the issue in transition(within the same issue) or on a related issue, like a subtask, a linked issue, or an issue within an Epic (during the transition on the Epic). In addition to setting values to fields, the Update any Issue Field post function can also add comments.

Configuration

You must specify the field and the desired value. For example:

Precondition

If you are using preconditions with a JSU post function, you can use the following options to define how the precondition is evaluated:

  • Ignore precondition (default): Every precondition is ignored which means that the post function will always be performed

  • True: Precondition must be true to execute a post function

  • False: Precondition must be false to execute a post function

    Example of precondition settings as described on this page.

The precondition setting is available on our post function configuration pages, and it is set to ‘Ignore’ by default. You can learn more about our preconditions in Workflow Preconditions.

We use the Update any Issue Field post function like this in the 'Start Progress' transition of our Story issue types. If the Story is part of an Epic, the Epic status will be set to IN PROGRESS.

In the past, users forgot to change the Epic status in time and it was left as TO DO. Using JSU this does no more happen.

Update field on all issues related as

The field can be on the issue in transition(within the same issue) or on a related issue, like a subtask, a linked issue, or an issue within an Epic (during the transition on the Epic).

See Related Issues for more explanation on this topic.

Perform As User

When choosing a user account to run a post function, the account specified must have the appropriate permissions to perform the actions of the post function, for example, creating an issue or adding a comment. You can specify a different user account that owns the necessary permissions that acts only as a technical (impersonation), with broad permissions, but not used to log in to a Jira account as an individual. 

If you don't specify a user here, the transition on the related issue is performed as the same user who triggered this post function on the origin issue by default. Therefore that user must have the necessary permissions on the related issue. In some setups, that user might not have the required permissions on the related issue or even access to the project of the related issue.

In combination with the User is in Any Users condition, you can hide a transition from all users other than the 'Perform As User' user.

Issue field values

When defining field values, ensure that the value you enter is valid for the datatype of the selected field. Also verify that the context configuration for the project that uses the workflow will allow the modifying of the selected field. If not, the transition may fail at execution time. 

Typically you will use text or numbers as values.

See: Post Function Concatenation Operations

Cascading Select fields

For Cascading Select fields, you can either use the value of the option you would like to set, or its ID. In either case, there is no need to specify the parent option. For example:

  • Vehicles

    • Car

    • Train

    • Bus

  • Buildings

    • House

    • Skyscraper

Using Vehicles as the parameter for Field Value would set the field content to that option; similarly, if you use Train

Dynamic value macros

  • If you use %%CURRENT_USER%% as the field value, the user who triggered the post function will be set as the value.

  • If you use %%PREVIOUS_USER%% as the field value, the field is updated with the previous user assigned to the field.

  • If you use %%CURRENT_DATETIME%%as the field value, the current date and time will be set as the value.

  • If you use %%ADD_CURRENT_USER%% as the field value, the user who triggered the post function will be appended to the existing field content.

Obsolete since JSU version 1.4.10: %%ADD_CURRENT_USER%%

Please use the option 'Append value' combined with the macro '%%CURRENT_USER%%' instead.

Position of the post function

It is important to place the post function in the correct order of other post functions.

Create Transition

The Create transition is the first transition, which does not yet have a source status (only destination status - usually Open, but could also be another). Instead of using the Update any Issue Field post function in the Create transition, you might consider configuring a default value for that field.

If you are using the Update any Issue Field post function in the Create transition, you must put it after the "Creates the issue originally." but before the "Re-index an issue to keep indexes in sync with the database." post function. Depending on the field type, you must add the Store Issue post function after the Update Any Issue Field.

 Example configuration in the 'Create' transition - Click here to expand...

In step 4 the "Store Issue" post function is needed, which you must add manually in the workflow configuration. In our example, we use a Workflow Precondition before the Update any Issue Field post function.

Any other Transition (not Create)

Use the Update any Issue Field post function anywhere before the Update change history for an issue and store the issue in the database post function

Examples

  • See the above example of a Story changing the Epic Status of its Epic. Or, whenever a parent issue is set to IN PROGRESS, the assignee of all its subtasks could be set to the current user (the one changing the status on the parent).

  • A developer fixes a bug and proceeds in the Jira workflow to the RESOLVED status (this might be triggered from his code pushed to Bitbucket). The 'Update any Issue Field' now adds the label 'testing-required'.
    There are also cases when you need a more complex solution. Have a look at Testing and Fixing Bugs.

For more information on how to configure a post function in Jira, see the Jira documentation.

Supported field types

JSU supports many different field types such as system fields and custom fields. However you should be aware, that not all field types are supported, and not in all combinations. We aim to cover the most important field types and are continuously adding and improving how different field types are supported. Some custom fields of other third-party apps might never be supported. You should always test anything you do with issue fields with JSU. You can try it with a free 30-day evaluation license.

  • No labels