import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueFieldConstants
import com.atlassian.jira.issue.fields.FieldManager
import com.atlassian.jira.issue.Issue
// Parent Task Summary
def parentTaskSummary = issue.getParentObject().getSummary()
// getting the list of sub task
Collection<Issue> subTasksList = issue.getSubTaskObjects()
// iterating on the list of sub tasks
for(subTask in subTasksList){
def value = subTask.getCustomFieldValue(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Component/s"))
}
What is your question?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use .setSummary() method: https://docs.atlassian.com/software/jira/docs/api/8.4.1/
def parentTaskSummary = issue.getParentObject().getSummary()
Collection<Issue> subTasksList = issue.getSubTaskObjects()
for(subTask in subTasksList){
MutableIssue missue = ComponentAccessor.getIssueManager().getIssueObject(subTask.getKey());
missue.setSummary(parentTaskSummary)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use log.error()
log.error(parentTaskSummary) should show you the data stored in the variable in the logs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ava.lang.NullPointerException: Cannot invoke method getSummary() on null object
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How you access the issue? Are you using the script listener or maybe you are running script in console? If it is the script listener, which event fire it up?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am getting an error:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.config.SubTaskManager
import com.atlassian.jira.issue.MutableIssue
Issue issue = event.issue
if (issue.getIssueTypeId() != "17319") {
//log.info "not a Build"
return
}
def changeStartDate = event?.getChangeLog()?.getRelated("ChildChangeItem").find {it.field=="Build Name / SW Version"}
if (changeStartDate){
// get newly set value for Start date
def CFStartDate = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_24992") // Start date
def CFVStartDate = CFStartDate.getValue(issue)
Collection<Issue> subTasksList = issue.getSubTaskObjects()
for(subTask in subTasksList){
MutableIssue missue = ComponentAccessor.getIssueManager().getIssueObject(subTask.getKey());
missue.setSummary(CFVStartDate)
//////////errormessageat/// missue.setSummary(CFVStartDate)
check if the declared type is correct and if the method exists
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.