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

get FilePath of changes from Server-side WorkItem Save pre.

We have a procedure that requires a certain checklist be attached to reviews of certain types of files. I would like to check the full path of the changes that are associated to a work item going out for review. My thought is to create a workItem save precondition to make the check when a work item is resolved and creates an approval.

I can get the changeSets that are linked to the work item just fine, but I can't figure out how to get a configuration so I can locate the ancestors of the FileItems. Is this possible to do from a server-side work item save precondition?

If this is not possible, would it work to hook into the delivery operation to make the check and set some sort of flag (custom attrib?) on the work item that I could then check for on the work item save operation?

Thanks!

0 votes



3 answers

Permanent link
Hi,
you have to use IScmService.configurationLocateAncestors method and then navigate the returned INameItemPair list. You can obtain a configuration using ServiceConfigurationProvider but you must have an IWorkspaceHandle (which could be a stream or a repository workspace) in order to get a configuration. Without a stream you could not have any configuration.

Best regards,
Michele.

We have a procedure that requires a certain checklist be attached to reviews of certain types of files. I would like to check the full path of the changes that are associated to a work item going out for review. My thought is to create a workItem save precondition to make the check when a work item is resolved and creates an approval.

I can get the changeSets that are linked to the work item just fine, but I can't figure out how to get a configuration so I can locate the ancestors of the FileItems. Is this possible to do from a server-side work item save precondition?

If this is not possible, would it work to hook into the delivery operation to make the check and set some sort of flag (custom attrib?) on the work item that I could then check for on the work item save operation?

Thanks!

0 votes

Comments

Notice that if you use IScmService#configurationLocateAncestors() on a deleted file,  the IAncestorReport#getNameItemPairs() will return an empty array.

instead, if you use IScmService#configurationDetermineAncestorsInHistory(), the IAncestorReport#getNameItemPairs() will return the proper segments.


Permanent link
Hi,
So, does it possible to make a server side plugin and get the file list out of a workitem?
Is it possible to use IWorkspaceHandle or stream handle with server side plugin?
If yes, could you please copy your code ?
It's very important for me.
Thanks!

0 votes


Permanent link
note that there are TWO toolkits..  (three if u are trying to d an external java app, Java Standalone toolkit)

SDK - server side general methods
Source Code Mgmt  toolkit - for interfacing the the RTC SCM.

you would have to combine functions from both..


0 votes

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
× 10,940

Question asked: Apr 13 '12, 1:46 p.m.

Question was seen: 4,417 times

Last updated: Jun 28 '13, 6:00 a.m.

Confirmation Cancel Confirm