How do I use the javascript API to get information from an artifact without it causing a history edit?
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! |
2 answers
Ralph Schoon (63.6k●3●36●46)
| 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.
See How should I ask a question in the Forum if I want to receive useful answers? for some considerations.
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.
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. |
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
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.
Comments
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.
I am specifically using xml, Thanks!