It's all about the answers!

Ask a question

How do I use the javascript API to get information from an artifact without it causing a history edit?


Bassem El-Tawil (111) | asked Jun 29 '23, 6:11 a.m.
edited Jul 10 '23, 8:30 a.m.

 

Been trying to figure it out for awhile, Still new to Jazz. Should I subscribe to the event? or is there a way to get the information in the artifacts without it? Still not sure if its the subscribing thats causing the issues or not.


To be more descriptive, Its an api using xml that searches Jazz for a specific term and creates links to it. The problem it has is that when it creates links to the artifact, it also sets it as modified in the history which is behavior I dont want happening. Im not sure if I can share the snippet of code, but what seems to happen is that subscribing to the event is whats causing the history to be modified rather then just referenced which is something Im not quite sure how to fix.

 

Thanks!


Comments
David Honey commented Jun 29 '23, 7:21 a.m. | edited Jun 29 '23, 7:21 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Your question is rather vague. I suggest you reference which API (URL to page that describes it) you are talking about and give specific detailed examples of what you're trying and the results.


Bassem El-Tawil commented Jun 29 '23, 3:42 p.m.

 I am specifically using xml, Thanks!

2 answers



permanent link
Ralph Schoon (63.2k33646) | answered Jun 30 '23, 2:26 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 If you expect answers, I would suggest to provide reasonable questions and information. 


Comments
Bassem El-Tawil commented Jul 10 '23, 8:31 a.m.

Sorry, Ive tried to make it as specific as I can


David Honey commented Jul 10 '23, 12:46 p.m. | edited Jul 10 '23, 12:47 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

All you have mentioned to date is a Javascript API and that you are using XML.

Presumably got some information about this API from a WIki page or other online reference. What is the URI of that Wiki page or online documentation page?

What Javascript classes/methods of the API are used?
Provide some sample code of what you have tried so far.


Ralph Schoon commented Jul 11 '23, 1:13 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I think they might talk about this API: https://jazz.net/wiki/bin/view/Main/RMExtensionsMain but I am not sure since it seems to be too complicated to provide such information. 


permanent link
Davyd Norris (2.3k217) | answered Jul 11 '23, 4:01 a.m.
The key is here:

"To be more descriptive, Its an api using xml that searches Jazz for a specific term and creates links to it. The problem it has is that when it creates links to the artifact, it also sets it as modified in the history which is behavior I dont want happening."

When you say you are creating links to the artefact, do you mean you're making an actual ELM link of some sort, or do you mean you're just working out a URL that points to the artefact? If the script is actually creating a link then it's modifying the artefact - so it's going to trigger an audit log entry

Comments
Bassem El-Tawil commented Jul 12 '23, 9:44 a.m.

Thank you! So if the code finds the term its looking for in the artifacts it creates a link and modifies the history which is wanted, but the problem is that when it doesnt find the term its looking for, it doesnt create a link, but still modifies the history and creates an audit log entry. So in order to avoid that, Im not sure if its the event subscription that causes the audit log entry, or if it is the .getattributes function that causes the entry. Im sorry if what Im saying doesnt really make sense, I wasnt involved in the development of this code, so Im not sure exactly what everything does yet.


Davyd Norris commented Jul 13 '23, 8:29 p.m.
The subscription wouldn't do it, and I've never seen getAttributes trigger an audit event either. We really need to see the code unfortunately.

There is an example widget in the IBM Samples that gets attributes from artefacts - you could load that up and confirm that an audit is not triggered, but I'm almost positive it doesn't - there must be something in the code elsewhere that does.

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.