JMWE Cloud: Event-based actions using 'Issue Field Value Changed' event don't trigger when the Parent field is modified

JMWE Cloud: Event-based actions using 'Issue Field Value Changed' event don't trigger when the Parent field is modified

 Problem

The Issue Field Value Changed event doesn't trigger when an issue's parent is set. This is despite the event being configured to look for changes to the following fields:

  • Epic Link

  • Parent

  • Parent Link

 Solution

The Issue Updated event is the actual Jira event that triggers when an issue's parent is changed.

  1. Create an Issue Updated event.

  2. To restrict the post-functions in the event-based action from running when the issue is updated but the parent field isn’t modified, use the following code to conditionally execute post-functions:

    {{ context.changelog.fields | field("IssueParentAssociation") is not null }}
  3. If you need to check the values of the parent's previous value and updated value (before and after the change), you can use the following code to conditionally execute post-functions in the event-based action:

    {# The previous value of the Parent field #} {{ context.changelog.fields | field("IssueParentAssociation") | field("from_string") }} {# The new Parent field value #} {{ context.changelog.fields | field("IssueParentAssociation") | field("to_string") }}

This configuration detects all changes made to the Parent field. If you want to restrict it to adding a parent, add context.changelog.fields | field("IssueParentAssociation") | field("to_string") is not null to the conditional execution script. Conversely, if you want to detect only the removal of an issue's parent, use context.changelog.fields | field("IssueParentAssociation") | field("to_string") is null.

 Related articles