Jira calculated field based on another calculated field

Vitaly K July 3, 2013

Hi, I have a Jira custom field setup that includes several scripted fields with pieces of common logic. So, field 1 returns some number based on issue fields, field 2 returns some more info based on number in field 1 etc As you might guess, i'm not fond of copy-pasting scripting code from one script to the other, but all my attempts to use getFieldValue to get the current value of another SCRIPTED field returned NULL/empty values. Am i missing anything?

(UPDATED)

Field1 (scripted field)returns constants depending on issue fields, type etc (simplified version here):
return 5

Field 2 (scripted field) looks like:
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
def custField = customFieldManager.getCustomFieldObjectByName("Field 1")
if (custField)
return issue.getCustomFieldValue(custField) // TODO: some transform
else
return null

--

this always produced null / empty for Field 2

3 answers

0 votes
Vitaly K July 4, 2013

Hi Bhushan,

I've updated the original post with code...

0 votes
Vitaly K July 4, 2013
Hi, Ive updated the original post with code...
0 votes
Bhushan Nagaraj
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.
July 4, 2013

Hi Vitaly,

Hard to guess without looking at your code. Will you be able to post the code here?

Suggest an answer

Log in or Sign up to answer