Hi
I would like Parent(Primary task) CF field value(select list) to another CF(text field) using script Listener.
Here is my script. Please help me out.
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField
import java.sql.Timestamp
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.event.type.EventDispatchOption
//import com.atlassian.jira.user.ApplicationUser
def customFieldManager = ComponentAccessor.getCustomFieldManager()
//def cField = customFieldManager.getCustomFieldObject("customfield_14815")
log.info("productList????//")
//def issueManager = ComponentAccessor.getIssueManager()
def changeHolder = new DefaultIssueChangeHolder()
Issue issue = event.issue
def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "Product List"}
//log.info("reporter++++++++++++") //for checking in execution
if (change) {
//issue.getSubTaskObjects()?.findAll { it.issueType.name in ["Sub-task"]
def subtask = ComponentAccessor.getIssueManager().getIssueByCurrentKey(it.key)
def cField = customFieldManager.getCustomFieldObject("customfield_14815")
log.info("test*****")
subtask.getCustomFieldValue(cField)
def customField = issue.getCustomFieldValue(cField)
def productLine = customFieldManager.getCustomFieldObject("customfield_15300")
issue.setCustomFieldValue(productLine)
log.info("productLinevalue*****")
ComponentAccessor.getIssueManager().updateIssue(issue, subtask, EventDispatchOption.DO_NOT_DISPATCH, false)
}
Thanks,
Vamshi
logs aren't printing. Can you please provide the sample.
Where i need to copy field value (select list) to another CF(Text field) from parent to subtask.
Please help me out.
Thanks,
Vamshi
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.