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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

124 views 4 9
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