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

How to extend the precondtion that validate the owner doesn't belong to team area before save workitem on RTC

I hope to extend the save workitem procondition that validate the owner doesn't belong to team area. if  the owner does not belong to the team area,the workitem don't save success.
We use RTC4.0.6 version.
Where can I find this API?
Has any example  like it?
please help me ! Thank you very much!

0 votes


Accepted answer

Permanent link
Chen, you will have to write that yourself.

There are various examples for this kind of API on https://rsjazz.wordpress.com/ most of the posts there are based on examples on Jazz.net https://rsjazz.wordpress.com/interesting-links/ for more. For development you should look into https://jazz.net/library/article/1000. Currently that works only for RTC 4.0. It is in the progress of being updated to make it usable for other RTC versions. I am not sure however, when we will get it on the web site.

https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ contains common API you would be interested in.

Most examples on the blog are follow up actions. The difference between an advisor and a follow up action is the extension point as described in https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/

Good luck.



 
chen fengmiao selected this answer as the correct answer

0 votes

Comments

Thank you Ralph,I will try to read the examples on rsjazz.wordpress.com .

Hi,Ralph. I don' t find the API: which team area does the owner  belong to on workitem?

Chen, the team area the work item belongs to can be found using the category.
To understand what team area and what role a user has, have a look at https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ the method SampleCurrentUserHasRoleCondition can give you some hints. Also interesting API (but client API) is described in https://rsjazz.wordpress.com/2012/12/09/analyzing-a-aroject-areas-members-and-roles-using-the-plain-java-client-libraries/ . To understand what you are up to if you want to do this, start reading here: https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/

Not sure right now, if using permissions would be easier. If the user is not member of the team area, what role does he have? Prevent "Everyone" from saving the work item?
I would try that first. I am currently not completely sure if users that are member of the project or parent project areas have. See https://jazz.net/library/article/291

Hi Ralph,on fact  I want to make these warning message to the error message ,prevent the user save the work item if appear this error message , I have to extend the procondition?



This has nothing to do with a precondition. I am not sure how this is implemented. It might be a validator. I think it is built in and not configurable. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization to understand validators. JavaScript however would not allow you to do this either, due to its API limitations. An option would possibly be a java based validator as described in https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ . This would work for the Web UI and the Eclipse UI. An advisor/precondition would only prevent the save and not show an error.

Permissions would also just prevent the save.   

Thank you for Ralph's answer . you mention the suggest "Permissions would also just prevent the save."   it see https://jazz.net/library/article/291  ?

Have you opened the link? It describes how permissions work.

Hi Ralph, I can open the link. I readed this article ,but I don't what can I ?

I am not aware of any way to achieve the change you desire - making the warning an error in the display. There are only the following ways I am aware:

  • Use permissions - only users with certain roles in the team area (which requires to be member of the team, except for the Everyone role)
  • Extend RTC with a Java based validator that checks the condition and returns the error AND using the operational behavior Attribute Validation (should give you exactly what you ask for) - I checked and the mechanism above showing the icon
  • Extend RTC and create an advisor/precondition that prevents saving

What you see above is configured this way:

and shows in the presentation editor like this:

And I am not aware you can change this to error.


showing 5 of 10 show 5 more comments

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

Question asked: Mar 21 '14, 9:11 a.m.

Question was seen: 3,206 times

Last updated: Mar 24 '14, 4:21 a.m.

Confirmation Cancel Confirm