Hi Team,
How to set the field values in target project summary. I am using script post function (Cloning an issue, and links). Here i am planning to create a ticket from source project to target , but I want to add the source field as summary of the target project. I tried with this script, but the ticket is not creating in target project, when I removed the I was able to create the ticket. Did I miss anything in the below script ? and please find the attached screenshot for your reference.
import com.atlassian.jira.component.ComponentAccessor
def optionsManager = ComponentManager.getComponentInstanceOfType(OptionsManager.class)
def customFieldManager = com.atlassian.jira.component.ComponentAccessssor.getCustomFieldManager()
def customfield1 = customFieldManager.getCustomFieldObjectByName("Hub Name")
def customfield2 = customFieldManager.getCustomFieldObjectByName("TPD Document Type")
def hubname = issue.getCustomFieldValue(customfield1)
def tpddoctype = issue.getCustomFieldValue(customFfeld2)
//Add Hub name and TPD Document Type to target project ticket summary.
issue.summary = + hubname + " / " + tpddoctype
Hello,
I've found two typos in your script:
I've changed your script a little bit, please try:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField customfield1 = customFieldManager.getCustomFieldObjectByName("Hub Name")
CustomField customfield2 = customFieldManager.getCustomFieldObjectByName("TPD Document Type")
def hubname = issue.getCustomFieldValue(customfield1)
def tpddoctype = issue.getCustomFieldValue(customfield2)
//Add Hub name and TPD Document Type to target project ticket summary.
issue.summary = hubname + " / " + tpddoctype
Thank you @Hana Kučerová for your quick help. It's working as expected.
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.