I'm trying to write a bit of code that pulls the @ user mention details from a specific line in the page properties of a particular page.
I'm using the PagePropertiesService with getReportFromContent(page) and then getAllMacroInstances().
I can then iterate through list returned by getAllMacroInstances(). I can locate the page property am looking for BUT getDetailStorageFormat() returns a blank string.
If I use a page property that is just a string typed into the page rather than a macro I get the expected text. It appears that getDetailStorageFormat() does not work when there is a macro involved.
It also appears that the PagePropertiesService is an undocumented API.
I borrowed quite a bit of code from here:
Has anyone else tried this?
I'm not 100% sure what you were going for with your approach to the macros, but you can search the body of a given page for an @ mention with this script
@-mentions take the form of ri:userkey="8aab818c73caedf00173caf477050000", where the string of characters is the user ID. Therefor if we parse the body of a page for that string, we'll turn up any @-mentions in the system.
Worth noting is the fact that while you can return the body of a page without the wiki markup, it doesn't include the @. So you'd just be searching for the name of the user, which is ultimately less specific.
&& page.version == page.latestVersion.version
){
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.