Adaptavist scripted field to a numeric field

tania_bernal_ssss_gouv_qc_ca January 31, 2019

My code

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.config.SubTaskManager

... blabla (work but not important for my question)

(result: sum = 100 in  customfield_10747 (scripted field))

 

def champMEA = customFieldManager.getCustomFieldObjectByName("MEA"); (works)
(In my form take the field numeric box MEA)

champMEA = ComponentAccessor.getCustomField("customfield_10747").getvalue()

(not working, how to update my field MEA with customfield10747 that contain 100 ???)

return sum

 

thank you

 

 

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2019

Your failing line of code is not referencing the issue, so it doesn't know where to get the data from.

Try

def theValue = issue.getCustomField(champMEA).getvalue()

tania_bernal_ssss_gouv_qc_ca February 1, 2019

Thank you

and also my type was not good :)

Have a good day

Suggest an answer

Log in or Sign up to answer