Import Values for multi-level field

Is there a way to import a list of values for a field to define the multi-level field values instead of copy/paste or manually typing them in? This is in regards to the "Multi-Level Cascading Select" add-on. API, command line, etc are all prefered over manualy typing them in.

com.sourcesense.jira.plugin.cascadingselect:multi-level-cascading-select

3 answers

Hi Michael,

Just to check, are you wanting to import values into the levels of an MLCS custom field or import options into the MLCS field configuration?

Field configuration.

While not currently supported by the plugin, it is possible to programatically add options to an MLCS custom field configuration if you're willing to write a short script in your language of choice.

You'll need to interact with the REST API, namely the following two URLs:

GET /rest/api/2/issue/createmeta

to discover which options already exist for the field configuration, and

POST /rest/multi-level-cascading-select/1/option?fieldConfigId={fieldConfigId}&optionValue={optionValue}[&parentOptionId={parentOptionId}]

for adding new options. You need to check existing options because otherwise you might create duplicate options with the same value.

Each field configuration affects one or more issue types for one or more projects, so the first step would be to find the following information:

  1. The field config id (look for the fieldConfigId URL parameter when editing options)
  2. A project in that field config's context (for the createmeta API)
  3. An issue type in that field config's context (for the createmeta API)

Then you should be set to start importing new options from your data source (CSV or whatever).

To add an option, call the MLCS REST API above. The optionValue must be URL encoded. If the parentOptionId is not included, the option will be created at the root level, otherwise the option will be created as a child of the specified parent option. For example,

# Add an option to the root level
curl -D- -u username:password -XPOST 'http://localhost:8080/rest/multi-level-cascading-select/1/option?fieldConfigId=10101&optionValue=First%20Level'

# Add an option as a child of an existing option (with id 10612)
curl -D- -u username:password -XPOST 'http://localhost:8080/rest/multi-level-cascading-select/1/option?fieldConfigId=10101&optionValue=Second%20Level&parentOptionId=10612'

Hope that helps.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,811 views 11 18
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
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