Could not create issue correctly with "Cascading Select"

xuhai zhao October 10, 2012

Hi, I am writing a plugin to copy issue from project of one JIRA instance to another. But there is a problem when create the issue on the remote JIRA instance.

The problem is that if the local issue contains a custom field of cascading select type, which means the values of this field may like this: parent option + first level option + second level option + ..., the remote created issue could not be created correctly.

As I known that the way to create an issue could use "IssueInputParametersImpl". Firstly, test the values of field of cascading select if the options are valid in the remote JIRA project, then populate the option IDs into the Input Parameters. This works well for other field types such as multi-select and some single value fields. But for the cascading select, I have tried to populate the option IDs into the InputParameters using this function:

addCustomFieldValue(Long customFieldId, String... values)

, it not worked well and only the parent option can be saved.

So my question is: is there a way to create issue with "Cascading Select CustomField" by using the IssueInputParametersImpl. If not, how to add cascading select values to an existing issue if I have got the issue, the customFieldID, the option IDs.
Thanks

1 answer

0 votes
EddieW
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.
February 28, 2014

Updating cascading selects is not as simple as regular fields. You need a few intermediate objects.


CustomFieldValue parentValue=new CustomFieldValue("customfield_10010",null,new String[]{"10600"});
CustomFieldValue childValue=new CustomFieldValue("customfield_10010",1,new String[]{"10601"});
values[0]=parentValue;
values[1]=childValue;
issue.setCustomFieldValues(values);

Suggest an answer

Log in or Sign up to answer