Skip to content

feat: add --clear option to remove due dates from Resolved tickets#589

Draft
asmorodskyi wants to merge 1 commit into
os-autoinst:masterfrom
asmorodskyi:clear_due_date
Draft

feat: add --clear option to remove due dates from Resolved tickets#589
asmorodskyi wants to merge 1 commit into
os-autoinst:masterfrom
asmorodskyi:clear_due_date

Conversation

@asmorodskyi

Copy link
Copy Markdown
Member

Allow backlog-set-due-date to also clear due dates for tickets
in Resolved status via the -c/--clear flag.

@asmorodskyi

Copy link
Copy Markdown
Member Author

I haven't tested it because I don't have API key

Comment thread backlog-set-due-date Outdated
Comment on lines +82 to +84
$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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite some duplication but should be easy to refactor with an extracted helper function and then call it like

Suggested change
$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

@asmorodskyi

Copy link
Copy Markdown
Member Author

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 ?

Comment thread backlog-set-due-date
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By default it sets due dates on In Progress tickets. With --clear
By default, it sets due dates on "In Progress" tickets. With --clear

Comment thread backlog-set-due-date
specified conditions.

By default it sets due dates on In Progress tickets. With --clear
it removes due dates from Resolved tickets instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it removes due dates from Resolved tickets instead.
it removes due dates from "Resolved" tickets instead.

Comment thread backlog-set-due-date

Options:
-h, --help display this help
-c, --clear remove due dates from Resolved tickets

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-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.
@asmorodskyi asmorodskyi marked this pull request as draft June 1, 2026 14:30
@asmorodskyi

Copy link
Copy Markdown
Member Author

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

Comment thread backlog-set-due-date
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\"}}" \

@perlpunk perlpunk Jun 1, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants