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.

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"});

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,164 views 5 10
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