diff options
| author | Teddy Wing | 2018-04-18 22:05:49 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-04-18 22:05:49 +0200 | 
| commit | a7b31fd5482ba822f2a3fd95fe35069cdf427bec (patch) | |
| tree | 3a49def33840c3a4b4cf4f6dd79abbff1d5a0be6 | |
| parent | a2cacedf44d2488528cae45ecc1b48483903be62 (diff) | |
| download | redprine-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-x | redprine | 18 | 
1 files changed, 18 insertions, 0 deletions
| @@ -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"  } | 
