aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-04-18 22:05:49 +0200
committerTeddy Wing2018-04-18 22:05:49 +0200
commita7b31fd5482ba822f2a3fd95fe35069cdf427bec (patch)
tree3a49def33840c3a4b4cf4f6dd79abbff1d5a0be6
parenta2cacedf44d2488528cae45ecc1b48483903be62 (diff)
downloadredprine-a7b31fd5482ba822f2a3fd95fe35069cdf427bec.tar.bz2
update_redmine_status(): Build the JSON to send to Redmine
This is the information that I need to update in the script. It's hard-coded for now, but I'll want to generalise it later. Maybe by making the entire JSON string a user-supplied parameter. This will update the appropriate fields for the issue.
-rwxr-xr-xredprine18
1 files changed, 18 insertions, 0 deletions
diff --git a/redprine b/redprine
index fefa7bf..eadec8a 100755
--- a/redprine
+++ b/redprine
@@ -160,8 +160,26 @@ function update_redmine_status () {
cut -d ' ' -f 2 -
)
+ # status_id=14 # Review
+ # done_ratio=100
+ # issue[custom_field_values][11] # Pull Request
+ local json="{
+ \"issue\": {
+ \"status_id\": 14,
+ \"done_ratio\": 100,
+ \"custom_field_values\": {
+ \"11\": \"$pull_request_link\"
+ }
+ }
+ }"
+
+ # echo "$json"
+ # echo "${REDMINE_BASE_URL}/issues/${issue_id}.json"
curl \
+ --verbose \
+ --header 'Content-Type: application/json' \
--request PUT \
+ --data "$json" \
--location "${REDMINE_BASE_URL}/issues/${issue_id}.json"
}