feat: add --clear option to remove due dates from Resolved tickets#589
feat: add --clear option to remove due dates from Resolved tickets#589asmorodskyi wants to merge 1 commit into
Conversation
|
I haven't tested it because I don't have API key |
| $prefix curl -v -H "X-Redmine-API-Key: $redmine_api_key" -H 'Content-Type: application/json' -X PUT \ | ||
| -d "{\"issue\": {\"due_date\": \"$due_date\", \"notes\": \"Setting due date based on mean cycle time of SUSE QE Tools\"}}" \ | ||
| "$host/issues/$id.json" |
There was a problem hiding this comment.
Quite some duplication but should be easy to refactor with an extracted helper function and then call it like
| $prefix curl -v -H "X-Redmine-API-Key: $redmine_api_key" -H 'Content-Type: application/json' -X PUT \ | |
| -d "{\"issue\": {\"due_date\": \"$due_date\", \"notes\": \"Setting due date based on mean cycle time of SUSE QE Tools\"}}" \ | |
| "$host/issues/$id.json" | |
| set-due-date "$due_date" "Setting due date based on mean cycle time of SUSE QE Tools" "$id" |
and correspondingly above with a literal "null" instead of computed due-date
|
also I think we should rename the file because current name not accurate anymore but I would like to do in separate commit so the diff of actual changes would be still readable . Does it make sense ? |
55205df to
e5c1c7b
Compare
| This script sets the due date on tickets in Redmine based on | ||
| specified conditions. | ||
|
|
||
| By default it sets due dates on In Progress tickets. With --clear |
There was a problem hiding this comment.
| By default it sets due dates on In Progress tickets. With --clear | |
| By default, it sets due dates on "In Progress" tickets. With --clear |
| specified conditions. | ||
|
|
||
| By default it sets due dates on In Progress tickets. With --clear | ||
| it removes due dates from Resolved tickets instead. |
There was a problem hiding this comment.
| it removes due dates from Resolved tickets instead. | |
| it removes due dates from "Resolved" tickets instead. |
|
|
||
| Options: | ||
| -h, --help display this help | ||
| -c, --clear remove due dates from Resolved tickets |
There was a problem hiding this comment.
| -c, --clear remove due dates from Resolved tickets | |
| -c, --clear remove due dates from "Resolved" tickets |
Allow backlog-set-due-date to also clear due dates for tickets in Resolved status via the -c/--clear flag.
e5c1c7b to
c721e68
Compare
|
so verification runs showing that it does not work out of the box . and one hour time invested didn't help to find why . moving to draft and postponing work on it for now |
| update-due-date() { | ||
| local due_date=$1 notes=$2 id=$3 | ||
| $prefix curl -v -H "X-Redmine-API-Key: $redmine_api_key" -H 'Content-Type: application/json' -X PUT \ | ||
| -d "{\"issue\": {\"due_date\": \"$due_date\", \"notes\": \"$notes\"}}" \ |
There was a problem hiding this comment.
If $due_date is null, then you're passing the string null, which is probably invalid (as it is not a date). So in case of null the quotes should be removed.
You wrote that it failed, and I don't know what exactly failed, but this could be the reason.
Allow backlog-set-due-date to also clear due dates for tickets
in Resolved status via the -c/--clear flag.