14 Jul 2023 09:32 AM - last edited on 11 Sep 2023 12:48 PM by Ana_Kuzmenchuk
Hi Team,
I am creating a workflow in the new Dynatrace; this workflow has a DQL query as 1st task, and then in 2nd task(js code) I want to add this DQL result to the dashboard. Here I want to update the dashboard by DQL results.
How to do that? Somebody, please provide some examples.
I read somewhere using document service, we can create a notebook, similarly, I want to create a dashboard using js code.
Regards,
Heramb
Regards,
Heramb Sawant
Solved! Go to Solution.
18 Jul 2023 04:47 AM
Hey Heramb,
You can use the new platform API for this. To get there you would go to https://Your.Tenant.Address.com/platform/swagger-ui/index.html?urls.primaryName=Document%20Service#/. Currently this is documented in our developer docs here https://developer.dynatrace.com/platform-services/#swagger-ui
Then from there you could follow the following steps to see how the document creation and editing process works as well as the format for requests:
Once you have a template setup you would then in your script just do POST /documents to create a new document with your desired DQL OR do PUT /documents/{id}/content to update an already existing document with your DQL query.
Hope this helps!
18 Jul 2023 06:12 AM
Hey thanks Fin for your help. This will definitely help to move forward.
Regards,
Heramb
11 Sep 2023 11:04 AM
Hey ,
I m trying to update my own dashboard( having id f3592b6d-XXXXXXXX411ae35) using "updateDocumentContent" method but getting below exception
Uncaught (in promise) 409: Share of type 'environment' with access 'read' already exists for document 'f3592b6d-XXXXXXXX411ae35'. errorRef: 282afd6c-2125-435b-8af5-f92fd10d670a
What needs to be changed?? and What should be the value of optimisticLockingVersion???
Regards,
Heramb
12 Sep 2023 07:44 AM
Hey ,
Somebody please help me on this.
Regards,
Heramb
21 Sep 2023 02:51 AM
Hey Heramb,
Hopefully you've already come across the solution. I was unable to find anything regarding that exact error or reproduce it but as for the optimisticLockingVersion field, if you first GET the document you'll get a version returned. This is NOT the version in the document JSON but in it's metadata. The optimisticLockingVersion field needs to be this latest version. Every time a document is updated, this version will update and to update it through the API you'll need this latest version every time.