It's all about the answers!

Ask a question

Navigation from a Work Item to other Website


Chandan M B (1134084) | asked Apr 09 '15, 1:44 a.m.
edited Apr 09 '15, 2:12 a.m. by Ralph Schoon (63.3k33646)
Hello,
Assume
On Save of a Work Item , i need to navigate to "www.google.com"
I have written a server side plugin, on click its coming inside my code snippet and also i am able to get workitem id.

But i need to know how to navigate to the respective url so that it opens in the browser. 
Regards
Chandan

Comments
Chandan M B commented Apr 09 '15, 7:11 a.m.

Desktop desktop=Desktop.getDesktop();
                    try{
                        desktop.browse(new URI("www.google.com"));
                    }catch(Exception e){
                        e.printStackTrace();
                    }


Ralph Schoon commented Apr 09 '15, 8:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Is that your working version?


Chandan M B commented Apr 09 '15, 8:33 a.m.

Yes.
When i save a workitem, i will get workitem id.
As soon as i got the workitem id i need to pass it to my web application to retrieve all the contents in my application and modify the WI using oslc


Ralph Schoon commented Apr 09 '15, 9:07 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Then the snippet above does not make that much sense to me.
If this is on a work item save

  1. You should use a Follow Up Action, because you want to modify the work item.
  2. You would not browse to that page, you would use REST calls under the cover, invisible to the user and perform your modification in a second save.
  3. Please note, if you try to use an advisor instead: https://rsjazz.wordpress.com/2012/12/14/do-not-modify-the-triggering-element-in-an-operationadvisor/


Chandan M B commented Apr 09 '15, 11:03 p.m.

Hi Ralph,

I will explain my scenario.

I created a new task in ALM by entering the attributes.
On click of save, task is created as well as a new task has to get created in my custom web application.

To do this, on click of save , i took the WI id and pass it to my application.
From the URL , i will pick up my id and through OSLC i query the values which i entered during the creation of task in ALM and display in my application.

User will press save so that all the values also will get save in my application also.
This will reduce human effort of entering data twice.

Suppose, if user changes somethings in my application, i will update the WI using OSLC.

This is mainly to have sync with both the tools.

Regards
Chandan


Ralph Schoon commented Apr 10 '15, 3:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I stay with my previous statement, in your scenario don't navigate to the page in the UI, you use the http libraries available on the server, or any other feasible API to open a connection under the hood and communicate to that web application.

The code above does not seem to make that much sense as an approach to me.


Chandan M B commented Apr 24 '15, 8:21 a.m.

Hello Ralph,
Yes you are right . Its not working when i deployed in my local jazz server.
Please provide me the code snippet. How to navigate to my web application on click of save. Currently i am passing the WI id to it.

I should navigate as soon as i click save on my WI. Please help

Regards
Chandan

showing 5 of 7 show 2 more comments

Be the first one to answer this question!


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.