I can easaly get:
/wiki/api/v2/pages/9111140/versions
/wiki/rest/api/content/9111140/state
But the latter only shows current state and I cant find a combi or any extensions as in:
wiki/api/v2/pages/9111140/versions?expand=metadata.properties.content_state_draft,metadata.properties.content_state_published
To get the historical "content status'es".
The goal is to find the latest "verified":
And show it in a (Scriptrunner) macro on the page or similar...
Any good ideas for the last part - feel free - I cant find any native macros supporting such a thing.
I have saved the code at https://www.mos-eisley.dk/display/it/Using+Content+Status+in+Cloud+-+POC
Hi @Roma Bubyakin _Wombats Corp_ and anybody looking here....
I actually got a Scriptrunner Listener and Macro pretty well configured:
But I stopped due to the fact (and built in automation has the same) - The event "page updated" or "page status changed" fires after the page is persisted with the content status.
So - When my automation - or Scriptrunner listener - sets the content status back from "Verified" to "In Progress" - the will be an extra Page version (14) shown as "Verified" in the History, but it has actually changed from the actually verified (13):
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Normann P_ Nielsen _Netic_
I was also not lucky enough to find a way to get historical status.
Seems that a possible solution is to store the status each time on change in the page properties. E.g.:
{
"key": "lastVerififedVersion",
"value": "12"
}
It might be possible with the automation
...however, I doubt that it would be an easy task, if realistic.
1. Web request to the properties endpoint required username:token pair
2. There is no "upsert" endpoint. If no such property yet you have to create it:
POST https://{base}.atlassian.net/wiki/api/v2/pages/{pageID}/properties/
{
"key": "lastVerififedVersion",
"value": "12"
}
3. Update requires valid incremented version and accessible with property ID
PUT https://{base}.atlassian.net/wiki/api/v2/pages/{pageID}/properties/{propertyID}
{
"key":"lastVerififedVersion",
"value": "15",
"version": {
"number": 2
}
}
It seems too tricky for automation, but a normal task for ScriptRunner or the custom forge app.
P.S. a bit easier it works with API v1 with property key instead of ID:
GET https://{base}.atlassian.net/wiki/rest/api/content/{pageID}/property/lastVerififedVersion
Regards, Roman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Roma Bubyakin _Wombats Corp_
No, not optimal - and {{page.version}} is not a smart value (a feature request do exist for it)
And im not sure how to get that into a WebRequest body...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.