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.
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.