It's all about the answers!

Ask a question

how to create a Button in a workitem using server side java API ?


vinitha dsouza (1271468) | asked Jan 21 '16, 6:52 a.m.
Hello Team

I want to know How can we create a button in a workitem using server side API ?

Also how can we give actions to the button ?

Please let me know how can we do this using server side API .


Accepted answer


permanent link
Ralph Schoon (60.9k33643) | answered Jan 21 '16, 7:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
See https://jazz.net/library/article/782/ . Please note, I haven't found how to do that in the Eclipse client.
vinitha dsouza selected this answer as the correct answer

Comments
vinitha dsouza commented Jan 22 '16, 1:38 a.m.

Hello Ralph

Thank you so much for the info :)
Can i know how i can deploy this button feature in the server .
Because when i add this code and run the server i am not able to get this feature .

I deployed using updatesite .


Ralph Schoon commented Jan 22 '16, 2:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Read https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ follow the links and do the extension workshop.

Enable yourself in debugging server extensions, because otherwise you just waste a lot of time.

The blog has other examples and the most recent server extensions also show how to create an environment that allows deploying more easily compared to the manual process shown in the Extensions Workshop.



vinitha dsouza commented Jan 22 '16, 8:47 a.m.

Hello Ralph

I could Deploy the Toolbar action code  using update site ..And its succssfull.

I could see the Image ( Add related defect ) in the UI in story workitem.
But when i click on that ,The action is missing.
I imported the code from
https://jazz.net/library/content/articles/rtc/3.0.1/linked-defect-toolbar-action/snippets
/net.jazz.example.workitem.web.zip.

Please let me know where i m going wrong .???



Ralph Schoon commented Jan 22 '16, 9:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

How should I know? I created an example based on this and it works for me. I don't know if I had to change anything. The action to be performed is in the LinkedDefectEditorToolbarAction.js file.

Debug it on Jetty.


vinitha dsouza commented Jan 27 '16, 3:42 a.m.

Hi
Thanks ..It worked for me ...'
I have one more concern ..

How can I copy attributes (  Eg: Summery,Filed against ...)  from  story workitem to Defect workitem In the Above javascript ?
Can we Automatically Save the created  Workitem  (here it is Defect) using above javascript ?

Thank you in advance ...


Ralph Schoon commented Jan 27 '16, 4:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I believe from https://jazz.net/library/article/782/ you would use the code below to get at the attributes you want. I don't have more to contribute, as I have not done this myself.


  // Calculate current Project Area and Work Item Type
      this._currentWIType = new String(this.workingCopy.getValue({ path: "attributes.workItemType.id"}));
      this._currentPArea = new String(this.workingCopy.getValue({ path: "attributes.projectArea.id"}));



vinitha dsouza commented Jan 27 '16, 4:21 a.m.

Hi

Yes above code i have already used to get the value ..

But my concern is how can we set the value  to the new workitem created using above script?

showing 5 of 7 show 2 more comments

Your answer


Register or to post your answer.