It's all about the answers!

Ask a question

Should not allow RTC work item to close until linked git merge request (Pull request) is merged

Chandra Prakash k (21213) | asked Mar 24 '22, 1:47 a.m.

we have registered the EWM project area with Gitlab repo for android source control development. 

in one of the audit we found that developers are closing the Task/Defect, before merging the associated merge request. resulting, when lead tries to merge the changes, hooks restricting that closed work item should not be used when merge or commits happen.

So we would like to know if there is any out of the box or workaround available to control closing the work item when linked merge request is in open state.

Chandra Prakash

One answer

permanent link
Ralph Schoon (62.7k33643) | answered Mar 24 '22, 3:40 a.m.
edited Mar 24 '22, 3:41 a.m.

 To control anything like that, would require to configure some kind of precondition/advisor in EWM Process Configuration Team Configuration>operation Behavior (Web UI Preconditions & Follow-up Actions).

There are operations available for "Git" and for "Save Work" Item that could be relevant for this. There is no "save work item" precondition that I can see that would allow to guard this.

I do not know what operation you want to actually guard. For GIT there is only a set of preconditions available for GIT Push. First I would consider to enable "Restrict Association to Closed Work Items". But that does not help with the case where the users close the work item after it was associated. 

You could enable Require Work Items to Match Query and the query only return the work items that are open.

If that is not good enough you could check if the Jazz Community Git Connector see also see for all projects, provides something.

If this still does not provide with anything, it is possible to write custom preconditions for "Save Work Item" operations. I don't know if that is realistic as I do not know the GIT APIs. The work item save could check if there is a link to a GIT item and check the status of said item and prevent the state change.

Ralph Schoon commented Mar 24 '22, 4:04 a.m.

I am sorry, I realize you meant the PULL request. I do not see a way to configure any operation behavior for the Pull request. It might be possible to create custom operation behavior for save work item preventing the work item state change based on the state of a liked GIT thing. Not sure though.  

Chandra Prakash k commented Mar 24 '22, 7:27 a.m.

Thank you Ralph for your comments on my requirement. 

Your answer

Register or to post your answer.