-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathaddWorklog.sh
More file actions
executable file
·35 lines (27 loc) · 878 Bytes
/
addWorklog.sh
File metadata and controls
executable file
·35 lines (27 loc) · 878 Bytes
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
#! /bin/bash
# Make sure there is a ~/jiraissues.csv file in your home directory
# Format of the file should be like this
# KEY-1,2h,02/06/2021
# Just run the script
while read line
do
issuekey="$(echo $line | cut -d ',' -f 1)"
worklog="$(echo $line | cut -d ',' -f 2)"
d="$(echo $line | cut -d ',' -f 3)"
day=$(echo $d | cut -d '/' -f 1)
month=$(echo $d | cut -d '/' -f 2)
year=$(echo $d | cut -d '/' -f 3)
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/$issuekey/worklog" \
-d \
'{
"timeSpent": "'$worklog'",
"started": "'$year'-'$month'-0'$day'T18:00:00.751+0000"
}'
sleep .5
done < ~/jiraissues.csv
notify-send "Timesheets" "All done!"
exit