Change subtask field on other subtask status change

Alexandre simard-marquis March 9, 2020

We recently updated our workflow with some automation and QOL improvements. 

I have created a custom subtask call "QA subtask", this subtask only differs from a normal/generic subtask by one field called "Parent status". As you might think this field was added so that when all the other subtask are done, we can update this field to "Ready for testing" and an email is sent to the QA dep to let them know of the status change.

Basically I want to do something similar to:

  1. When a subtask is close
  2. Check parent if a "QA subtask" is present
  3. If one is present, check that all the other generic subtask are done
  4. If they are all done, change the "QA subtask" custom field "Parent status" to Ready for testing

Also, I am open to suggestions if you think there is a better way to inform QA.

2 answers

0 votes
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 10, 2020

I would personally recommend trying out JMWE, but I'm biased (I work for Innovalog).

A simple approach would be to:

  1. Add a "Ready for testing" Status to the workflow of regular (parent) issues. This enhances visibility and traceability for your users.
  2. On that transition, add a "Related Issue Status Condition" with the following parameters:
    1. Which issue(s): Sub-tasks of the current issue
    2. Issue type: the Issue type of your "regular" sub-tasks
    3. Statuses: "Closed" (or whatever your "closed" status is for sub-tasks)
  3. On the same transition, add a Set Field Value of Related Issue(s) post-function, with these parameters:
    1. Field: "Parent status"
    2. Which issue(s): Sub-tasks of the current issue
    3. Value: Ready for testing
    4. Only if condition is true: checked
    5. Condition: linkedIssue.get("issuetype")?.name == "QA subtask"
  4. On the same transition, add an "Email Issue" post-function to let users know that the issue is ready for testing
  5. On the "Close" transition of regular subtasks, add a "Transition Parent Issue" post-function to trigger the "Ready for testing" transition. Move the post-function to the bottom of the list.

This is one approach out of many possible approaches. For example, you could replace the Parent status custom field with a "Parent Status" field type from JMCF so you don't have to update the field manually (it will always show the parent issue's status). You could also do without the extra "Ready for testing" Status, or without creating two sub-tasks types and just relying on the sub-task Summary, but that would require a little scripting (a couple of lines of code in total using JMWE).

0 votes
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 10, 2020

This is totally doable, but it requires a third-party app, at least on Jira Server / DC. Do you already use an automation app? And are you on Server/DC or Cloud?

Alexandre simard-marquis March 10, 2020

I am in the process of trying some that are available before I narrow down to the one that suite best my needs. 

Ate the moment I had lots of success with "JSU Automation Suite for Jira" until I got to this automation.

I also installed "Automation for Jira" which seems to be more flexible but didn't quite figure out how to use it for this case.

I also read about "script runner" but I would like to stay away from scripting if possible.

Note that the automation implementation is new to us and all the mention plugin are in trials so I am open to suggestions.

And I am on a server.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events