Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

jira automation - convert issue into a subtask assigned to a task.

Gavin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 1, 2022

I'd like to do the following:

  • convert an action item into a sub-task under a specific task.
    • I have the part of converting action item to sub-task

But how do you assign a converted sub-task under a task?

1 answer

0 votes
Mark Segall
Community Champion
September 1, 2022

Hi @Gavin 

Assuming you're using the Edit Issue Action to change the issue type, you'll need to include the parent field as part of the edit.  If you're not able to select it from the available fields, you'll want to do it via json like this:

{
    "fields": {
        "parent": "PARENTKEY OR SMART VALUE"
    }
}
Gavin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 6, 2022

Thanks for the response. 

Unfortunately the didn't work.  in the audit log I got " Error while parsing additional fields. Not valid JSON.What kinda of worked was 

> edit issue

+ linked issue > is subtask of <parent>

 

{
"fields": {
"parent": "MDM-1920"
"environment": "Thanks for raising {{issue.key}}.",
"labels": [
"bugfix",
"blitz_test"
],
"Custom Field Name": {
"value": "red"
}
}
}

 

Mark Segall
Community Champion
October 7, 2022

Hi @Gavin - Let's take a step back on this one.  I don't think this one should require JSON.  Can you please share a screenshot of your rule?

Gavin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 7, 2022

So I was looking at the errors and it states "(Issue type is a sub-task but parent issue key or id not specified. (issuetype))" which was what you mentioned above but not seeing where I can put the parent ID.

01.png

02.png

03.png

Mark Segall
Community Champion
October 10, 2022

Just above where you selected Sub-Task as the issue type, there's a drop-down "Choose Fields to Set" where you can set the desired fields you wish to edit as part of it.

Note - That warning message is critical.  If your Task and Sub-Task have different workflows, this is going to fail.  The only way that you can use automation to convert one issue type to another is if they share the same workflow.  Otherwise, this would be a "Move" operation which is only possible through a manual function on the Jira UI

Gavin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2022

thanks for the response.  Hmm I'm looking at it there 

I'm not seeing where I can set the parent ID.

01.png02.png

03.png

Mark Segall
Community Champion
October 10, 2022

Makes sense that parent isn't there because you're currently editing an issue type to change into a sub-task.  I would just take the following action:

  • Add any relevant fields from the picker that you can set there (from your previous screenshot, it looked like you were trying to set Environment and Labels).  
  • In the More options section, replace everything there with this:
    • {
          "fields": {
              "parent": "MDM-1920"
          }
      }

Lastly, is the expectation that every action item will become a child of MDM-1920 for perpetuity, or just this one situation?  If the former, you're all set.  If the latter, you'll need some type of business logic to help define what parent it should be linked to.

Gavin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2022
Adding json, in the auditing 
Error while parsing additional fields. Not valid JSON.

{
"fields": {
"parent": "MDM-1920"
"environment": "Thanks for raising {{issue.key}}.",
"labels": [
"bugfix",
"blitz_test"
],
"Custom Field Name": {
"value": "red"
}
}
}

Suggest an answer

Log in or Sign up to answer