Could not create issue correctly with "Cascading Select"

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

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
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

26,155 views 2 7
Join discussion

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