I am trying to clone a defect issue type creating a bug issue type using a manual trigger and while cloning initialize some bug fields. The bug depending on the input value from the manual trigger can be created in the same project or in a different one I also added a link to the defect issue type. Everything works fine, but now I want to add subtasks. I need to do it within the same rules because the bug can be created in a different project, so I want to do it as part of the Clone issue action.
Here is for example the JSON file for the case the bug is created within the same project:
{
"fields": {
"customfield_10100" : { "id": "{{severity.get(issue.customfield_10262.id)}}"},
"customfield_10101" : { "id": "{{type.get(issue.customfield_10264.id)}}"},
"customfield_10103" : { "id": "{{environment.get(issue.customfield_10266.id)}}"},
"customfield_10162" : "{{product}}"
},
"issueUpdates": [
{
"fields": {
"issuetype": {"id": "10003"},
"project": {"key": "IFR"},
"summary": "Research Issue"
}
},
{
"fields": {
"issuetype": {"id": "10003"},
"project": {"key": "IFR"},
"summary": "Implement Fix"
}
},
{
"fields": {
"issuetype": {"id": "10003"},
"project": {"key": "IFR"},
"summary": "Validate Fix"
}
}
]
}
When I run the rule I don't get any error, the bug is created, with the corresponding values and linked to the defect, but the subtasks are not created. For creating the subtasks I took the idea from the Bulk create issue,
So the portion of the JSON file that is not working is the action: issueUpdates. Instead of using the project id, I am using the project key, but the rest is the same, removing the fields I don't need to set.
The issue type id is 10003, I got by putting in the browser the following (adding previously a sample temporary subtask to have a subtask section):
https://MYSITE/rest/api/latest/issue/IFR-532
and looking to the following portion within the subtask node of the JSON response:
"issuetype": {
"self": "https://pan-american.atlassian.net/rest/api/2/issuetype/10003",
"id": "10003",
"description": "A small piece of work that's part of a larger task.",
"iconUrl": "https://pan-american.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10316?size=medium",
"name": "Sub-task",
"subtask": true,
"avatarId": 10316,
"hierarchyLevel": -1
}
here is the Audit log of the execution:

and here is the content of the rule:

Here is the portion of the rule for the case of generating the bug within the same project:

Here is the bug generated:

Any help is appreciated. Thanks in advance.