It's all about the answers!

Ask a question

Warning during WorkItem link deletion


Angelo Corna (25948270) | asked Oct 12 '17, 12:06 p.m.

Is there the possibility (also with a plugin) to display an alert when a work item link is deleted?


Thanks in advance.
Bye

2 answers



permanent link
Luca Martinucci (1.0k282109) | answered Oct 12 '17, 1:38 p.m.

Angelo,
I would write a follow-up action on work item save that does the following:

  1. retrieve all links that have been deleted during the current action;
  2. if this deleted links set is not null, send an alert.
Point 1 can be addressed by using the method getDeletedReferences (for each endPointDescriptor)

List<IReference> removedReferences = new ArrayList<IReference>();
IWorkItemReferences refs = saveParameter.getNewReferences();
removedReferences = refs.getDeletedReferences(endPointDescriptor);

I have no ready-to-use examples, instead, for point 2.


Comments
Angelo Corna commented Oct 16 '17, 2:10 p.m. | edited Oct 16 '17, 5:40 p.m.

Luca,

thanks for your response but my request is a little different.
I don't want a notification during the save but a warning when I delete a link. Is it possible?

Bye.


Luca Martinucci commented Oct 17 '17, 5:55 a.m.

Angelo,
I would define a check attribute on the work item, basically a flag, that must be checked to enable links deletion.
An advisor should read this attribute on work item save and return a validation error if it is not flagged and a link has been deleted.
In order for the "warning" mechanism to work, this attribute should be unflagged every time a new action on the work item begins, or simply after a positive check (that is, first you check whether the attribute is flagged; if it is not, return an error; if it is, unflag the attribute and let the action complete without errors).


Luca Martinucci commented Oct 17 '17, 5:56 a.m.

Sorry, a follow-up action, rather than an advisor, would better perform this check.


Ralph Schoon commented Oct 17 '17, 6:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Follow up action are not what should be used to prevent saving in such a case. A pre-condition or advisor should be used.


Ralph Schoon commented Oct 17 '17, 6:49 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The design with the flag does not seem to be a good one. Way too complex and annoying. You will also have all the attribute changes in the work item history.

I don't know if there is a good way to implement this.


Luca Martinucci commented Oct 17 '17, 7:02 a.m.

Regardless of the considerations about the complexity of the solution, perhaps the only way to implement it is to develop both an advisor (to perform the check), and a participant (follow-up action) to unflag the attribute after any action.


Ralph Schoon commented Oct 17 '17, 7:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I have not been able to come up with a better solution.

In the Eclipse client there is a feature to override some of theĀ  advisors. I am not sure if that is available in the web UI.

Another thought was to use additional save parameter to communicate but I have not found a real scenario either.

showing 5 of 7 show 2 more comments

permanent link
Ralph Schoon (60.5k33643) | answered Oct 17 '17, 3:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Oct 17 '17, 6:05 a.m.

The simple answer is no. The UI is not even built for pop up windows.
You can use an advisor to prevent saving, It will show an error on the work item editor and/or in the Eclipse process advisor, but that is about it.

Your answer


Register or to post your answer.