It's all about the answers!

Ask a question

Is it possible restrict saving a task until a particular link is created between the task and another work item?


kuo hao tah (1132730) | asked Oct 11 '12, 9:48 p.m.
Hi there,

Is it possible restrict saving a task until a particular link is created between the task and another work item?

For our design, it is important that every task MUST have a parent work item. Is it possible to restrict saving the task until a parent work item is added?

Thanks,

KH

3 answers



permanent link
Lauren Hayward Schaefer (3.3k11427) | answered Oct 12 '12, 7:07 a.m.
JAZZ DEVELOPER
Hi,
I'm not sure if it's possible to require the parent link type.  However, you could add a custom attribute of type Work Item and then make that attribute required.

Comments
kuo hao tah commented Oct 14 '12, 7:08 p.m.

Hi Lauren,

 

Thanks for your reply. Could you please elaborate more? I'm interested to know what you mean by 'add a required attribute of type Work Item' , and how that might help provide a workaround solution for my issue, ie

 

every task MUST have a parent work item. Is it possible to restrict saving the task until a parent work item is added?

Thanks,

 

KH


permanent link
Lauren Hayward Schaefer (3.3k11427) | answered Oct 15 '12, 6:49 a.m.
JAZZ DEVELOPER
edited Oct 15 '12, 6:50 a.m.
Hi,
You could add a new custom attribute of type work item:
  1. Open the Eclipse client
  2. In the Team Artifacts view, right-click on your project area and choose Open
  3. Click on the Process Configuration tab
  4. Expand Project Configuration
  5. Expand Configuration Data
  6. Expand Work Items
  7. Click on Types and Attributes
  8. Select the work item type you'd like to add the attribute to
  9. In the Attributes section, click Add...
  10. Type the name and if of your attribute (something like Parent).  Select Work Item as the type

You'll then need to add the attribute to the editor so the attribute will be displayed:

  1. Click the pencil icon next to Work Item Editor
  2. Select the section where you want the attribute to be displayed and click Add Presentation
  3. Select Attribute Based Presentation
  4. Select your attribute and the kind as Work Item

Finally, you'll want to make your attribute required:

  1. In the left Configuration pane, expand Team Configuration > Operation Behavior
  2. In the Operations table, select the cell under Work Items > Save Work Item (server) and Everyone (default)
  3. In Preconditions, select Required Attributes for Type and State
  4. In Category or Type, select your work item
  5. Click Edit...
  6. Select your attribute and click OK
  7. Click Save 

This won't create a two-way link like regular links do, but it will ensure that every work item has indicated what its parent work item is.


Comments
kuo hao tah commented Oct 16 '12, 11:38 p.m.

Hi Lauren,

Thanks for that suggestion. I've implemented exactly as your description, and works exactly as how you described. However, this would require the user to complete 2 steps :

a) First create a Link between the task and a parent work item

b) Then add the work item ID that should be the parent

It would be great if there was automatically a link between the new 'Parent' attribute and the actual parent link. In fact, this already exists in the 'quick information' 'Parent' link, we just need some way to make that relationship mandatory.

Thanks,


KH


permanent link
Ralph Schoon (61.1k33643) | answered Oct 17 '12, 1:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 You could create a custom precondition to require the link.  http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ has all you would need. https://jazz.net/library/article/1000 describes the details. It is not trivial though.

Comments
Lauren Hayward Schaefer commented Oct 17 '12, 6:35 a.m.
JAZZ DEVELOPER

Nice post! I didn't realize that was possible.


Ralph Schoon commented Oct 17 '12, 6:46 a.m. | edited Oct 17 '12, 6:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Well, I just realized there are some slight differences between what is needed and what is in the post. The post describes a participant.

You probably want an Advisor which runs as pre-condition. Small differences to the Participant though. The extension point is com.ibm.team.process.service.operationAdvisors, your implementing class has to implement IOperationAdvisor, but the rest is pretty much the same. The code needed here would be to check for the parent link. (which is in the blog). If it does not exist you would indicate an error.

I shall blog about Advisors versus Participants.

Your answer


Register or to post your answer.