Guides
July 08, 2021 · 6 min read

Customfield Editor for Jira now supports Multi-Level Cascading Select

with full REST API and GUI support

The Customfield Editor for Jira app now supports the field type Multi-Level Cascading Select by Sourcesense. The Multi-Level Cascading Select customfield type supports any number of levels and is an awesome addition to the built in Jira customfields.

Minimum System Requirements

For all the parts to work nicely together you will need to meet these requirements:

Demo

Once you have all apps installed in the required versions you can add options via the Field Editor as you would with any other supported field type. You can use the endless cascading possibilities now while delegating managing options to non-admin users via the Field Editor. Setting default options, sorting options alphabetically (ASC/DESC), updating and deleting options works seamlessly.

Of course the Audit Log Feature of the Customfield Editor for Jira is supported as well out of the box.

REST API

All the REST API Endpoints of Customfield Editor for Jira can be used with the newly supported field type as well. Full delegation to a non admin user works with this field-type as well as all admin endpoints.

Listing custom fields as admin now contains the new fieldType
multi-level-cascading-select.

$
BASE_URL="https://jira.srv/rest/jiracustomfieldeditorplugin/1"
curl -i -H "Content-Type: application/json" \
  -u admin:admin \
  $BASE_URL"/admin/customfields?startAt=0&maxResults=10"

response
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8

{
  "maxResults": 10,
  "startAt": 0,
  "total": 1,
  "processingTimeInMs": 2,
  "values": [
    {
      "fieldId": 10107,
      "fieldName": "Bike Components",
      "fieldDescription": null,
      "fieldType": "multi-level-cascading-select",
      "fieldGlobalPermission": true,
      "contexts": [
        {
          "contextId": 10208,
          "contextName": "Default Configuration Scheme for Bike Components",
          "contextDescription": "Default configuration scheme generated by Jira",
          "isGlobal": true,
          "isAllIssueTypes": true,
          "isAllProjects": true,
          "projects": [],
          "issueTypes": []
        }
      ]
    }
  ]
}

For the /user/ endpoints to work for the desired non-admin api user, we first need to set permissions on the desired field. You have to grant bob global field permissions on the bike components field with id 10107.

$
BASE_URL="https://jira.srv/rest/jiracustomfieldeditorplugin/1"
curl -i -H "Content-Type: application/json" \
  -u admin:admin \
  -X PATCH \
  -d '{"user":"admin","action":"GRANT","type":"GLOBAL"}' \
  $BASE_URL"/admin/customfields/10107"

Now you can add a 1st level option with value drivetrain.

$
BASE_URL="https://jira.srv/rest/jiracustomfieldeditorplugin/1"
curl -i -H "Content-Type: application/json" \
  -u bob:s3cret \
  -X POST \
  -d '{"optionvalue":"drivetrain"}' \
  $BASE_URL"/user/customfields/10107/contexts/10208/options"

response
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8

{"optionvalue":"drivetrain","id":10015,"sequence":3,"disabled":false}

To add a 2nd level child with value pedals to the 1st level option use the special child options endpoint.

$
BASE_URL="https://jira.srv/rest/jiracustomfieldeditorplugin/1"
curl -i -H "Content-Type: application/json" \
  -u bob:s3cret \
  -X POST \
  -d '{"optionvalue":"pedals"}' \
  $BASE_URL"/user/customfields/10107/contexts/10208/options/10015/childoptions"

response
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8

{"optionvalue":"pedals","id":10016,"sequence":1,"disabled":false}

To add a 3rd+ level child with value Shimano XT PD-M8140 to the 2nd level option use the special child options endpoint as well.

$
BASE_URL="https://jira.srv/rest/jiracustomfieldeditorplugin/1"
curl -i -H "Content-Type: application/json" \
  -u bob:s3cret \
  -X POST \
  -d '{"optionvalue":"Shimano XT PD-M8140"}' \
  $BASE_URL"/user/customfields/10107/contexts/10208/options/10016/childoptions"

response
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8

{"optionvalue":"Shimano XT PD-M8140","id":10017,"sequence":1,"disabled":false}


If you want to set a default option simply specify a list of option ids in parent/child/child/... order. For example to set the default option drivetrain (10015), pedals (10016) and Shimano XT PD-M8140 (10017) use this request.

$
BASE_URL="https://jira.srv/rest/jiracustomfieldeditorplugin/1"
curl -i -H "Content-Type: application/json" \
  -u bob:s3cret \
  -X POST \
  -d '{"optionIds":[10015, 10016, 10017]}' \
  $BASE_URL"/user/customfields/10107/contexts/10208/options/default"

response
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8

{
  "defaultOptions": [
    {
      "optionvalue": "drivetrain",
      "id": 10015,
      "sequence": 0,
      "disabled": false
    },
    {
      "optionvalue": "pedals",
      "id": 10016,
      "sequence": 1,
      "disabled": false
    },
    {
      "optionvalue": "Shimano XT PD-M8140",
      "id": 10017,
      "sequence": 1,
      "disabled": false
    }
  ]
}


You can do even more with the REST API – simply check the REST API documentation.


Update Notice

I have installed the latest app version, but my Multi-Level Cascading Select customfields do not show up in the Field Editor!

Should you be a long time user of our App and already have Multi-Level Cascading Select customfields and an older version of our app installed, then you need to re-run the JobIndexCustomFieldSearchTable Job once to update the search table. You only need to do this once. When you create new Multi-Level Cascading Select customfields while the Customfield Editor app is installed it will automatically update the search table.

We are already working on a solution so that the search-table will be obsolete in future app versions. Then there will be no need to update it manually anymore.

To update the search table go to AdministrationManage AppsCustomfield Editor SettingsJobs and click on the play-button on the right side of the JobIndexCustomFieldSearchTable job row. This will schedule the job for execution. Once it is done you can reload the page and it should show status success again.


Summary

We are very happy to support another field type and empower our users to delegate work to non-admin users on this newly supported field type .