SIL - retrieve information for fields from another project

Hi Guys,

I'm trying to use Kepler Custom Fields and the script below but get an error on the create screen and no options to select from on the edit screen.

Error:Script is not running in the context of an issue.Cannot get value for field customfield_13608 at com.keplerrominfo.jira.plugins.keplercf-pro:sil-options-multi-select-cf/com/keplerrominfo/jira/plugins/keplercf/pro/optionscf/selectcf-edit.vm


Project A:

Field A = Value 1,2,3

Project B :

Field A = Value 1,2,3

Field B = Value 1,2,3

What i want to achieve is , when i type in value 1 on field A on the create / edit screen of Project A, i want it to match the same value of field A on Project B and return field B's values .

The script im using is linked to an 'Info' custom field using a multiline text field (customfield_13606).

Consider field A on project A as customfield_13608


KPOption[] selectedValues = customfield_13608;
customfield_13606 = "";
string [] allIssues = selectIssues("project=SERVICE and status=production order by summary");
// string[] selectedKeys;
string headingsText = "|| Type || Summary || Key || Production Group || Platform ||";
string contentText;
for (KPOption v in selectedValues) {
for (string iss in allIssues) {
if (iss.summary == v.value) {
// selectedKeys = addElement(selectedKeys, iss.key);
string[] fields = getIssueFields(iss.key);

string[] fieldAItems = fields["customfield_10314"]; // because the Production Group field is a multiselection

string[] fieldBItems = fields["customfield_10286"]; // because the Platformp field is a multiselection

contentText += "\n| " + iss.type +" | " + iss.summary + " | " + iss.key
+ " | " + fieldAItems + " | " + fieldBItems + " |";
if (isNotNull(contentText)) {
customfield_13606 = headingsText + contentText;


1 answer

I realised the error as it was my fault.

The script was matching on custom field 13608-

KPOption[] selectedValues = customfield_13608;

However, the values in that field were never going to match what i was fetching from the other project as that field was producing a different result set! Made sure that field had the same as the keys in the destination project and that resolved it.

Suggest an answer

Log in or Join to answer
Community showcase
Jason Wong
Published yesterday in Agility Beta

Welcome to agility

Every team in the world is unique, and so   Atlassian believes   that each and every team's best way of working  needs to  be molded to their unique circumstances  – ...

391 views 6 16
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot