-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcreateIssue.sh
executable file
·55 lines (48 loc) · 997 Bytes
/
createIssue.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
51
52
53
54
55
#! /bin/bash
issuetype_id="10001"
project_id="10037"
priority_id="2"
description="This is a desction of the issue"
summary="Test issue created from a shell script"
template='{
"fields": {
"summary": "%s",
"issuetype": {
"id": "%s"
},
"project": {
"id": "%s"
},
"priority": {
"id": "%s"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "%s",
"type": "text"
}
]
}
]
}
}
}'
json_final=$(printf "$template" \
"$summary" \
"$issuetype_id" \
"$project_id" \
"$priority_id" \
"$description")
curl -i -X POST \
-H "Authorization:Basic $JIRATUTORIAL_AUTH" \
-H "Content-Type:application/json" \
-H "X-Atlassian-Token:no-check" \
"https://jiratutorial.atlassian.net/rest/api/3/issue/" \
-d \
"$json_final"