-
Notifications
You must be signed in to change notification settings - Fork 22
/
editIssue.sh
executable file
·50 lines (45 loc) · 1 KB
/
editIssue.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/bash
issue_key="an-233"
priority_id="3"
description="Upated: This is a description of the issue"
summary="Test issue updated from a shell script"
number_field=9999
text_field="Update: This is a text field"
template='{
"fields": {
"summary": "%s",
"priority": {
"id": "%s"
},
"customfield_10152":%s,
"customfield_10114":"%s",
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "%s",
"type": "text"
}
]
}
]
}
}
}'
json_final=$(printf "$template" \
"$summary" \
"$priority_id" \
"$number_field" \
"$text_field" \
"$description")
curl -i -X PUT \
-H "Authorization:Basic $JIRATUTORIAL_AUTH" \
-H "Content-Type:application/json" \
-H "X-Atlassian-Token:no-check" \
"https://jiratutorial.atlassian.net/rest/api/3/issue/$issue_key" \
-d \
"$json_final"