How to capture the click of the delete buttom from the "More" menu when someone is trying to delete an issue.

Craig Leigh January 6, 2015

I would like to capture the keystroke or click which executes the delete button when a user is trying to delete an issue.  I would then like to run a SIL script or Javascript which will check if any worklogs exist on the issue.  If they  do exist then prevent deletion and preserve the issue.  We have had users inadvertently delete issues with worklogs attached to them.  I believe that when this happens the action is irreversible and worklogs are unrecoverable.

6 answers

1 accepted

0 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2015

You can remove the permissions from "Delete" altogether and provide a dummy "Delete" issue operation (with the help of a plugin) that has an additional validation of worklogs. The new issue operation will not allow delete if the issue has worklogs.

Since the new 'Delete' behaves similar, except for the worklog validation, users will not be aware of any changes.

0 votes
Craig Leigh January 7, 2015

Matt, we do that now with permission schemes.  Users can delete their issues, projects admins can delete only their projects issues.  Issue security only limits who can see an issue.  We need to retain our current permissions , but flag those issues with worklogs only at the time of attempted deletion: Not who can delete by group, or role, which requires management of the group, user and/or role. 

Jobin, what plugin were you referring to?  Groovy (Script Runner) or something else?

--Craig

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2015

A simple JIRA plugin that has an issue operation exposed in it. I don't think we can leverage script runner for it because you will need a web-item and webwork module in it.

0 votes
MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2015

Or use a security scheme. Allow some role to change the security level and the the "deleted" issues disappear from most people's views. 

0 votes
Björn Brynjar Jónsson January 6, 2015

Hi Craig,

Nobe sorry don't know how to do it that way smile

Another solution (you probably know about also), is to make a policy decision to not allow regular users to delete issues and simply close the inadvertently created issues. We used this where I worked previously and it worked perfectly wink

But I understand it can be challenging to convince people to try a different way...

All the best

Björn Brynjar

0 votes
Craig Leigh January 6, 2015

 Hi Björn,

I understand the permission feature in Tempo. We have made a policy decision to allow a user to delete an issue they created inadvertently.  And allow only Tempo Project admins to delete other user's worklogs and only those in their project.  This presents a risk of inadvertent deletion.  We want to continue to allow this in order to not have to maintain groups and roles in a more granular fashion.  Notwithstanding we would like to capture and stop inadvertent deletions globally and grammatically, not by project permission which is what we have in place now.  Any insight on how to do it that way?

Thanks

--Craig

0 votes
Björn Brynjar Jónsson January 6, 2015

Hi Craig,

In the Project Permission scheme you can define who can and can not delete issues. Check this page and look for "Delete Issues":

https://confluence.atlassian.com/display/JIRA/Managing+Project+Permissions

All the best

Björn Brynjar

Suggest an answer

Log in or Sign up to answer