API Usage
Sena Demir
OPTIONS TREE REST API’S
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”
}
]
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”
}
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"
}
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”
}
URL: <jira_base_url>/rest/category-level-rest/1.0/root?id=20
Method: DELETE
Data: -
Result: -
OPTION REST API’S
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": []
}
]
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”
}
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": []
}
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": []
}
URL: <jira_base_url>/rest/category-level-rest/1.0/category?id=17792
Method: DELETE
Data: -
Result: -
URL: <jira_base_url>/rest/category-level-rest/1.0/category/move
Method: PUT
{
"id" : <Option ID>
"parentId": <New Parent ID>
}
*if the parent id is null, the option becomes a first-level option.
CUSTOM FIELD API
Jira's API is used to update/remove/add Multi Level & Tree Field 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"}}
]
}
}
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"}
}
}