Deleting a draft of an issue using workflow

Answered

I'm aware of using issue.applyCommand("delete") to delete a reported issue, however, I want my workflow to initiate when an issue becomesReported instead of isReported. It seems that the issue must be in the draft phase at this point.

Is it possible to delete a draft of an issue in workflow?

 

I couldn't find a command for this. When I try this in the command line on an open draft, the preview of the command says

"Delete command cannot be applied to draft issue. Use 'Clear draft' instead."

'Clear draft' is not a command, and may be referring to a button of a similar name.

 

I have issues that are automatically added to a project, but I want to delete the issues that have the same job ID (custom field value).

Thanks in advance.

0
3 comments
Official comment

Hello Brian,

you can't delete a draft via workflow, unfortunately. We can only suggest the following:

1) create a rule which will tag issues as something like 'To delete' at the moment of becomesReported

2) create another scheduled rule which will iterate through all your issues once in a while and delete the tagged ones via a command.

However, please note that if you use this approach, the issues will still exist in your system for some time.

Please let us know if we can help any further, thank you.

 

Avatar
Permanently deleted user

Thanks Liubov,

Do you know how I can reference the value of a tag in workflow?

0
Avatar
Permanently deleted user

issue.tags.contains(), got it.

0

Please sign in to leave a comment.