It's all about the answers!

Ask a question

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


Jason Fregien (58910) | asked Apr 13 '12, 1:46 p.m.
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!

3 answers



permanent link
Michele Pegoraro (1.8k14118103) | answered Apr 16 '12, 5:41 a.m.
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!

Comments
SEC Servizi commented Jun 28 '13, 6:00 a.m.

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
Yehiel Glass (25538986) | answered Jul 03 '12, 10:53 a.m.
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!

permanent link
sam detweiler (12.5k6195201) | answered Jul 05 '12, 8:51 a.m.
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..


Your answer


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