Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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

0 votes



3 answers

Permanent link
 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.

2 votes

Comments

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

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.


Permanent link
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.

1 vote

Comments

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
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.

0 votes

Comments

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

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,023

Question asked: Oct 11 '12, 9:48 p.m.

Question was seen: 5,410 times

Last updated: Oct 17 '12, 6:47 a.m.

Confirmation Cancel Confirm