When delivering how can I require that A certain workitem type is being used and it is in a certain state?
I am using RTC 6.0.5 with the SCRUM template.
I have been asked to allow deliveries to happen only if the following is true:
1) Must be associated with a work item either new or existing.
2) The work item type is Story or Task
3) The task is in an active state (for example: New or In Progress for a Task work item)
4) It is for the current sprint.
I believe that I do this some how in the Project or Team configuration Operation Behavior but I cannot see how to enforced these pre conditions for a delivery action.
Thanx in advance for the help
Accepted answer
You should be able to use the built-in conditions:
Require-Work-Items-and-Comments for (1) and (4)
Require-Work-Items-To-Match-Query for (2) and (3)
Comments
Yes, you can chain them, but as far as I can tell, it is impossible to require one work item has all the properties. With that approach you will also satisfy the conditions with two work items, one that satisfies 1 and 4 and one with 2 and 3.
And if you have more than one work item linked to a change set, you have to decide whether you want:
- all of the work items to satisfy all of the conditions,
- at least one of the work items to satisfy all of the condiditons
- each of the conditions to be satisfied by at least one of the work items
One other answer
You have to create your own custom advisor similar to this one.
https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/
You would have to have additional checks for the work item that is linked.
The built in precondition does not check for the work item type.
Comments
I need to see if they will allow me to create a custom advisor. If they are willing to forget about the work item type how do I do the other conditions:
1) Work Item must exist or be created.
2) The Work Item is in an particular state(s).
3) The Work Item is for the current sprint.
See com.ibm.team.filesystem.service.internal.ServerRequireWorkItemAdvisor once you are doing the extension workshop. See https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/.
1) If there is no work item (of that type) linked, fail
2) Test the state of the work item, fail
3) Figure out what the current sprint is and check the work item that is linked (see example of internal code above)