It's all about the answers!

Ask a question

How to modify the link type between two Work Items on action DONE


Erwin Kunz (94687086) | asked Jun 27 '13, 11:36 a.m.
edited Jun 28 '13, 3:45 a.m.
RTC 4.0.2

I have a Story with a linked child Task.  I would like to "change" the relation between the Task and the Story during action DONE.

I know how to do the change in the process to have a script running during an action DONE, but I do not know how to get the link, remove it and create a new one using JAVA

Any example would be appreciated
Thank you
erwin

 

Accepted answer


permanent link
Ralph Schoon (63.4k33646) | answered Jun 28 '13, 6:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You have to code a Java Participant that removes the old link and creates a new one. See https://rsjazz.wordpress.com/ for API examples and participant examples. This is across several posts, but it should be easy enough to find using the search window.
Erwin Kunz selected this answer as the correct answer

Comments
Eric Jodet commented Jun 28 '13, 8:10 a.m.
JAZZ DEVELOPER

 See also https://jazz.net/library/article/1229

(Discovering Links Between Items)

ILinkManager has methods like: createLink and createLink)

Thanks.
Eric


Erwin Kunz commented Jun 28 '13, 8:24 a.m.

I always forget to look at your blog..
Thanks Ralph,  I'll check you page and come back if I'm not able to do it :-)


Erwin Kunz commented Jun 28 '13, 8:57 a.m.

I there now way to do it in Java Script as Scripted-based Calculated Value... like I did to enforce Remaining work to 0?


Ralph Schoon commented Jun 28 '13, 9:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No.



The reason is JavaScript does not allow you to follow relationships. The JavaScript API does not know about links. Sorry.


Ralph Schoon commented Jun 28 '13, 9:07 a.m. | edited Jun 28 '13, 9:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Where you could look into could be http://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/. Not sure if you could do that in Java. The Java API you have available there is a bit richer, but still limited compared to a follow up action.


Erwin Kunz commented Jun 28 '13, 9:37 a.m.

You have not to be sorry :-)
Me as old perl developer would have preferred to use Scripted-based stuff


Ralph Schoon commented Jun 28 '13, 9:49 a.m. | edited Jun 28 '13, 9:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

There are discussions about API's provided. The issue is that if you wanted to use Perl, you would have to use REST/OSLC API's.
There are also discussions about making the JavaScript API richer.
But there is also a concern with respect to performance and users customize their tools so much that they render them unusable (and then blame the product).

Since the server API is in Java you have a lot more API available (dependent on the extension point). In addition you can also debug that relatively easy once you got through https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/ .

My personal experience with scripting is that I like it as much as embedded c development without debugger back in the 80's.   8-)


Erwin Kunz commented Jul 03 '13, 7:48 a.m.

Hi Ralph
How about just deleting the link to the Parent? Would that be possible with Scripted Based calculation


Ralph Schoon commented Jul 03 '13, 8:00 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No this is also not accessible.Links are in general not accessible in Java Script, neither create, nor delete or follow.

showing 5 of 9 show 4 more comments

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.