Using JIRA Automations how can I set the team of a sub-task to equal the parent issues team value?

Dave Markowski September 23, 2022

I have a situation for reporting that we want to report on teams and subtasks, but noticed you can not set the team of a subtask out of the box. Is it possible to do via an automation? 

 

My trigger is very simple 

When: Issue Updated

Issue Type is one of - Sub Task, Bug - Sub Task (custom) 

Then: Edit issue Fields 

I then have this in the edit field, but feel like I'm missing something 

{
"Fields":{
"Team": {{ parentIssue.fields.Team.value }}
}
}

 

(JSON is not my strongest language) 

Any help is welcome!

Thanks,
Dave

 

 

 

 

 

1 answer

1 vote
Bill Sheboy
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 23, 2022

Hi @Dave Markowski 

First thing, find the custom field id for your Team field, using this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

If the field is not present in the results, you probably cannot set it.

If the field is present, try setting it using the JSON syntax for a single-select field: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Single-select-custom-field

Kind regards,
Bill

Dave Markowski September 26, 2022

@Bill Sheboy ok so found the custom field id - customfield_12300

"customfield_12300": {
"id": "203",
"title": "FS - Aurora - White",
"isShared": true,
"name": "FS - Aurora - White"
}

Now how would I read it into the sub task?  

{
"Fields":{
"customfield_12300": {{ parentIssue.customfield_12300.name }}
}
}

Bill Sheboy
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 26, 2022

Please take a look at that second documentation link I sent; it shows two examples of how to do this, using the single-select id or the value.

Dave Markowski October 11, 2022

hi @Bill Sheboy  - really having a hard time with this.  Do you have an example of setting the custom field (team/customfield_12300 in my case) on a sub task to a value on a parent task? 

Dave Markowski October 11, 2022

@Bill Sheboy even when setting the following I seill get a an error - BHV-19015 (The Team must be a string (customfield_12300))

 

Here's the triggered JSON 

{
"fields": {
"customfield_12300": { "id" : 1 }

}
}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events