Hi,
As an admin i want to make sure issues can be deleted by USERS only if certain conditions are met, example -
1) Users cannot delete an issue if its in the resolved status
2) Users cannot delete an Epic if its child issues are completed
Is it possible to add such a condition in the workflow, so that a prompt shows up when a user tries to delete a resolved issue, similar to a workflow validation prompt
Hello @AisM ,
Sorry, busy days...
I agree with what have been answered already.
Consider using a specific resolution, status or project (i. e. archiving) instead of deletion.
That being said, for the 1st requirement, you can indeed use a property (as said before : jira.permission.delete.denied) on specific statuses ("unresolved" statuses) and set it to true.
To my knowledge, the 2nd requirement is not possible (but I have not looked that far). Of course it would be possible using a condition on a transition if you used a status "Deleted" instead of actually deleting the issues.
You can also refer to this question : https://community.atlassian.com/t5/Jira-questions/Is-it-possible-to-show-the-quot-Delete-quot-button-selectively/qaq-p/1338844
to check the details of the implementation.
@Antoine Berry Understandable !!!! :):) But thank you so so much for looking into it !
The workflow method worked, but the org did not like that approach of touching the workflow
So, I tried the scriptrunner hide element option to hide for resolved issues & it worked !
I want to incorporate two more conditions (hide delete if issue type is program epic & portfolio epic, and also for epics with completed child issues) into the script, but when I do, it doesn't work. Not sure what mistake I'm doing,
import com.atlassian.jira.component.ComponentAccessor
def issue = issue
if (issue.resolutionObject) {
return false
} else {
return true
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its not really possible to control the permitted issue actions from the workflow.
The workflow actions are the business logic and not the framework.
I've often restricted who can delete issues in project permissions as deletion errors are a pain. As is explaining to users there is no restore option for their work.
You can control when an issue can be deleted in a workflow via properties
e.g. add jira.permission.delete.denied to statuses
If you create a Delete status in the workflow you could set conditions on how that can be transitioned to. The Delete status could not have the delete denied property so making it available.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the comment !
Actually, I wanted to make a change to my question. We want to enable the delete feature to the users (Till now, its restricted to admins)
So, I have two conditions,
1) Only unresolved issue can be deleted
2) Epic with completed child cannot be deleted
So, if a user tries to delete an issue which is resolved, they must get a workflow style prompt that says "Completed issues cannot be deleted"
Is this possible with the mentioned workflow properties ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think my answer would be a variation of my first response.
You can widen the access to delete issue permission in the permission scheme.
And also restrict the permission in the status property jira.permission.delete.denied
Again allow to move to a Delete status, with no property jira.permission.delete.denied, and check on the transition to Delete that your conditions are met.
I don't know of any other ways to dynamically control access to the More/Delete option.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tom Lister , Thank you for the comments, I was actually able to try this out with the method you suggested. And it did work too !
But, that just complicated the already complex workflow, So we have dropped modifying the workflow. I am currently planning to hide the delete option through the Script fragments - Hide element option based on the conditions. But, that has its pros & cons too
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @AisM ,
Although it is not recommended to delete any issue, if you really want to do so, look at IssueService component and it's methods.
Hope that helps.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.