Hi All,
I have the fields in the parent want to display the values in th subtask.
Eg: I have associate name field (insight custom field) =abc & hiring manager (insight custom field) = xyz wanted the display the values of that in the subtask as requested for (custom field) = abc & associate name of parent values and opened by = xyz as hiring manager values in the subtask view page.
Please help me in the script runner code.
I tried to write the code in the script runner ,but iam getting null values or abc (CMDB -7899).
hi ravi,
i want to write the cript in the create transition of subtask .
as of now checking this in script console .
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueFieldConstants
import com.atlassian.jira.issue.fields.FieldManager
def issue = ComponentAccessor.getIssueManager().getIssueObject("IT-14555")
def parentIssue = issue.parentObject
def customField = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_13263")//Parent insight custom field (Assciate name)
def customField1 = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_13153")//Parent insight custom field (Hiring manager)
def requestorforCF = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_13416")//requested for (custom field in subtask (single line text field))
def openedby = ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_13257")//Opened by (custom field in subtask (single line text field))
def linkedIssueCustomFieldValue = parentIssue.getCustomFieldValue(customField)
def linkedIssueCustomFieldValue1 = parentIssue.getCustomFieldValue(customField1)
issue.setCustomFieldValue(requestorforCF, linkedIssueCustomFieldValue)
issue.setCustomFieldValue(openedby, linkedIssueCustomFieldValue1)
log.warn("request for :" + requestorforCF)
log.warn("opened by :" + openedby)
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Get the most out of Jira Service Management
Solve customer problems efficiently and deliver outstanding service experiences.
Learning Path
Adopt ITSM practices to deliver exceptional service
Become familiar with the principles and practices that drive ITSM. Then, learn how to configure and use Jira Service Management to implement them.
Atlassian Certified Associate
Jira Service Management Agent Essentials certification
Prove you know what's essential to providing efficient and resolution-focused service in Jira Service Management.
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.