unable to create task's subtasks using additional fields option (JSON)

Yohai_Mizrahi March 30, 2023

Hi, 

i'm trying to create a task and its subtasks using jira automation additional fields options

here is the JSON i used: 

{
     "fields": {
           "summary": "{{issue.summary}}",
            "subtasks":

              [
                  {
                        "transition": {
                                      "id": "221"
                         },
                         "fields": {
                                    "summary": "{{issue.summary}} runset",
                                    "issuetype": {"name": "Sub-task"},
                                    "parent": {"key": "{{issue.key}}"}
                           }
                      },
                     {
                         "transition": {
                                 "id": "221"
                           },
                           "fields": {
                                   "summary": "{{issue.summary}} test case",
                                    "issuetype": {"name": "Sub-task"},
                                    "parent": {"key": "{{issue.key}}"}
                          }
                     }
               ]
         }
}

i'm getting 

Unknown fields set during create, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored - Sub-tasks (subtasks) for some reason.

1 answer

1 accepted

0 votes
Answer accepted
Hala ElRoumy
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 8, 2023

Hello Yohai,

Allow me to answer your question here to help others as well. :)

The Additional Fields section is used to edit fields using JSON and not to create new issues. Usually, you can add a Branch immediately following the Create Task action. This branch can operate on the most recently created issue, and you can create sub-tasks there.

If you are already creating the tasks/subtasks inside a branch, you can't create a sub-branch. As a suggestion to create subtasks without changing the rule flow. You can save the parent task issue key in a variable and use this variable to update the parent field in the subtask. This way, the subtask will be created under the newly created task.

Here's a screenshot to illustrate this suggestion:
Suggestion.png


Thanks & Regards,
Hala ElRoumy
Atlassian Cloud Support 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events