Forums

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

Copy SLAS from Parent Task to Sub Task

Swarna Radha
Contributor
August 30, 2018

Hi,

I want to retrieve the value of the SLAs from the parent task and add on the sub task upon subtask creation. 

The code below is not working.

Please see code below:

import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.IssueManager import com.atlassian.jira.issue.Issue import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.issue.util.DefaultIssueChangeHolder import com.atlassian.jira.issue.ModifiedValue def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObject('customfield_13207') def parentMyFieldValue = issue.parentObject.getCustomFieldValue(field) def changeHolder = new DefaultIssueChangeHolder(); field.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(field), parentMyFieldValue),changeHolder);

Thanks

Swarna

2 answers

0 votes
Ramesses Souza
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 13, 2022

I believe a possible solution would be

I. Create a custom field (issue parent sla) to store the remaining sla of the parent issue.

II. Create slas for the subtasks based on the parent issue custom field. Example below:
issue parent sla <= 30h goal 29h
issue parent sla <= 20h goal 19h
issue parent sla <= 10h goal 9h
issue parent sla <= 5h goal 4h

0 votes
Alexey Matveev
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.
August 30, 2018

Hello,

What do you mean by SLA? is it the Jira Service Desk feature or is it a custom field, created by you?  

Swarna Radha
Contributor
August 31, 2018

Hi @Alexey Matveev,

It's a JIRA Service Desk feature

Alexey Matveev
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.
August 31, 2018

In this case you can not copy this field. This field is calculated by SLA settings. 

Suggest an answer

Log in or Sign up to answer