Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Next »

OPTINS TREE REST API’S

 Get All Options Tree

URL: <jira_base_url>/rest/category-level-rest/1.0/root

Method: GET

Data: -

Result: 

[

    {

        "self": "<jira_base_url>/rest/category-level-rest/1.0/root/18",

        "id": 18,

        "value": “Tech”

    }

]

 Get Option Tree By Id

URL: <jira_base_url>/rest/category-level-rest/1.0/root/<id>

Method: GET

Data: -

Result:

{

        "self": "<jira_base_url>/rest/category-level-rest/1.0/root/18",

        "id": 18,

        "value": “Tech”

}

 Create Option Tree

URL: <jira_base_url>/rest/category-level-rest/1.0/root

Method: POST

Data:

{

    "value": "New Option Tree"

}

Result:

{

    "self": "<jira_base_url>/rest/category-level-rest/1.0/root/20",

    "id": 20,

    "value": "New Option Tree"

}

 Update Option Tree

URL: <jira_base_url>/rest/category-level-rest/1.0/root

Method: PUT

Data:

{

    "id": 20,

    "value": "New Option Tree Updated”

}

Result:

{

    "self": "<jira_base_url>/rest/category-level-rest/1.0/root/20”,

    "id": 20,

    "value": "New Option Tree Updated”

}

 Delete Option Tree

URL: <jira_base_url>/rest/category-level-rest/1.0/root?id=20

Method: DELETE

Data: - 

Result: -

OPTION REST API’S

 Get All Options in Option Tree

URL: <jira_base_url>/rest/category-level-rest/1.0/category/by-root?rootId=<option_tree_id>

Method: GET

Data: -

Result: 

[

    {

        "self": "<jira_base_url>/rest/category-level-rest/1.0/category/35",

        "id": 35,

        "value": "Hardware",

        "path": "Hardware",

        "level": 1,

        "parentId": -1,

        "root": {

            "self": "<jira_base_url>/rest/category-level-rest/1.0/root/3",

            "id": 3,

            "value": "Tech"

        },

        "categoryRank": 1,

        "enabled": true,

        "categoryIssueTypes": [],

        "categoryGroups": []

    }

]

 Get Option By Id

URL: <jira_base_url>/rest/category-level-rest/1.0/category/<id>

Method: GET

Data: -

Result:

{

        "self": "<jira_base_url>/rest/category-level-rest/1.0/category/18",

        "id": 18,

        "value": “Tech”

    }

 Create Option

URL: <jira_base_url>/rest/category-level-rest/1.0/category

Method: POST

Data:

If a top-level option is to be added, the "rootId" value should be given "-1".
If a new option will be added under a parent; The id value of the relevant aprent should be written to the "rootId" value

In the example below, a new option is added under the option with 35 ids under the parent with 3 ids.

{
    "value": "New Option Tree 1",
    "parentId": 35,
    "rootId": 3,
    "issueType": [],
    "group": []
}

Result:

{
    "self": "<jira_base_url>/rest/category-level-rest/1.0/category/17792",
    "id": 17792,
    "value": "New Option Tree 1",
    "path": "Hardware/New Option Tree 1",
    "level": 2,
    "parentId": 35,
    "root": {
        "self": "<jira_base_url>/rest/category-level-rest/1.0/root/3",
        "id": 3,
        "value": "Tech"
    },
    "categoryRank": 7,
    "enabled": true,
    "categoryIssueTypes": [],
    "categoryGroups": []
}

 Update Option

URL: <jira_base_url>/rest/category-level-rest/1.0/category

Method: PUT

Data:

If a top-level option is to be added, the "rootId" value should be given "-1".
If a new option will be added under a parent; The id value of the relevant aprent should be written to the "rootId" value

In the example below, the option information with id 17792 is being updated.

{
    "id": 17792,
    "value": "New Option Tree 2",
    "parentId": 35,
    "rootId": 3,
    "issueType": [],
    "group": []
}

Result:

{
    "self": "<jira_base_url>/rest/category-level-rest/1.0/category/17792",
    "id": 17792,
    "value": "New Option Tree 2",
    "path": "Hardware/New Option Tree 2",
    "level": 2,
    "parentId": 35,
    "root": {
        "self": "<jira_base_url>/rest/category-level-rest/1.0/root/3",
        "id": 3,
        "value": "Tech"
    },
    "categoryRank": 7,
    "enabled": false,
    "categoryIssueTypes": [],
    "categoryGroups": []
}

 Delete Option

URL: <jira_base_url>/rest/category-level-rest/1.0/category?id=17792

Method: DELETE

Data: - 

Result: -

CUSTOM FIELD API

Jira's API is used to update/remove/add Multi Level & Tree Field on Issue.

 Update Multi Level & Tree Field (Multiple) on Issue

URL: <jira_base_url>/rest/api/2/issue/<IssueId or IssueKey>

Method: PUT

Data:

It can be traded according to option id or value.

{
"update": {
   "<customfield_id>":[
    {"set": [{"id":"17408"},{"value":"Employee Mail System"}]},
	{"add": {"id":"17446"}},
	{"remove": {"id":"17408"}}
   ]
 }
}

 Update Multi Level & Tree Field (Single) on Issue

URL: <jira_base_url>/rest/api/2/issue/<IssueId or IssueKey>

Method: PUT

Data:

It can be traded according to option id or value.

{
"fields": {
   "<customfield_id>":
      {"value": "Employee Mail System"}
   
 }
}
  • No labels