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

IBM RTC ccm work item java script, how detect or know when WI was created via OSLC vs Web interface

 Hello, 

I'm trying to trigger a specific behavior, but it will run only when the user opened the work item via web, not via oslc or rest or java, is there anyway to know where the source is comming? I know we can use the submitter user but, in my case does not apply. 
Thank you!

0 votes



One answer

Permanent link
The Work Item Proxy class is only available in the web client, and the same for the dojo libraries.

You can set up your JavaScript to check for either of these in order to work out if you're in the Web Client or somewhere else. Something like this should work:

if (typeof dojo.xhrGet === 'undefined') {
  console.log('We are not in the Web client any more, Toto');
} else {
  console.log('My spider senses are tingling! We are in the Web client');
}

0 votes

Comments

 hi it works when you trigger a custom attribute I mean when you put as dependent a custom attribute, but you but a dependent attribute that is non custom it doesn't work, is there any other way we can know?

Thank for all your help Davyd

What do you mean "it doesn't work" - can you state exactly what is happening?

Remember that if the code above is run on the server, you won't see anything in the web browser console (because it's running on the server!) - you'll see the message in the server logs instead.

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,941

Question asked: Jul 13 '19, 6:24 p.m.

Question was seen: 1,206 times

Last updated: Jul 15 '19, 8:43 p.m.

Confirmation Cancel Confirm