Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

Copy field value (the value before the transition) to another field

This article provides the code snippet to copy field value (the value before the transition) to another field using post-function.

This is a workaround until https://innovalog.atlassian.net/browse/MWEC-1133 is released.

 Instructions

  1. Navigate to the intended workflow to make the necessary changes in the edit mode.

  2. Select the required transition.

  3. Select the Post functions tab and click Add post function.

  4. Add the post-function.

  5. Select the issues for which the field should be set under “Target Issue(s)”.

  6. Select the desired field and add the below Nunjucks template:

    {{ context.changelog.fields["customfield_10062"].from_string }}

    Replace 10062 with the id of the source field.

  7. Select the checkbox “Run this post-function only if a condition is verified” under “Conditional Execution” and add the below Condition:

    {{ context.changelog.fields["customfield_10062"] }}

    Replace 10062 with the id of the source field. The above condition checks that the field value is changed during the transition. Check the documentation here.

Note: The post-function must be placed after the “Update change history for an issue and store the issue in the database” built-in post-function.

 

References