Forums

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

Set the cascading field value [ScriptRunner]

arno
Contributor
December 11, 2023

Hi All

We recently have a demand, need to automatically assign a concatenated field value according to two custom field values, want to know what function needs to be used for concatenated field assignment, my code is as follows:


import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.customFieldManager
def field = customFieldManager.getCustomFieldObject('customfield_12807')
def field1 = customFieldManager.getCustomFieldObject('customfield_13826')
def field2 = customFieldManager.getCustomFieldObject('customfield_13768')

def Platform = issue.getCustomFieldValue(field)
def Product = issue.getCustomFieldValue(field1)
def Plat = issue.getCustomFieldValue(field2)

log.error(Platform)
log.error(Product)
log.error(Plat)


def value = Platform.toString()
def value1 = Product.toString()


issue.setCustomFieldValue(field2,value,value1)

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events