how to use getIssueFields routine in jjupin for the current issue?

eric anier
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.
March 10, 2014

Hi,

i could use this routine getIssueFields to get fields of the parent task by using parent.key as parameter, but what should i use to access the fields in current issue, im coding SIL for live fields by the way.

my code..

string vRetVal;

string[] fields;

fields = getIssueFields(parent.key);

vRetVal = fields["reporter"];

return vRetVal;

Thanks,

eric

3 answers

1 accepted

1 vote
Answer accepted
Silviu Burcea
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.
March 10, 2014
string[] fields;

fields = getIssueFields(key);

key is a standard variable. You can find the rest of them here: http://confluence.kepler-rominfo.com/display/SIL/Variable+Resolution

1 vote
Alexandru_Iacob
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.
March 10, 2014

You can access the current issue fields by using the standard variables defined in SIL.

For example to retrieve the reporter for current issue you just have to use the standard variable reporter. For custom fields, you can access them either by id (eg. customfield_xxxxx) or by name.

For more details check this documentation page: http://confluence.kepler-rominfo.com/display/SIL/Variable+Resolution

Note that standard variables can be used without explicitly referencing the issue only when the script has an issue context, so not on create issue for example.

So, if you want to access some fields values on the create issue screen also, you have to use the live fields lfInstantHook routine: http://confluence.kepler-rominfo.com/display/JJUPIN/lfInstantHook

You have to provide the list of fields that you are interested in and a hook script in which you can access the value for these fields, using argv["<field_name>"].

If you want to get some field values from the screen after certain events (eg. changed, keyup), you should use the lfWatch routine for that field: http://confluence.kepler-rominfo.com/display/JJUPIN/lfWatch

Hope this helps.

0 votes
eric anier
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.
March 10, 2014

hi,

it seems that there are custom fields that can't be identified by the code below, tried using the equivalent customfield_XXXXX and it works.

vRetVal = fields["reporter"];

Thanks a lot,

Patrick Riegler March 29, 2016

Hi Eric

Yes, it does not work with some of the custom fields.
Did you find a solution to the case?

Thanks for your help.

Regards
Patrick 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events