Automation on editPage not showing the user results
Asked by Christian Humer:

Hello   
I added a integration with webhook. And if someone edits a page I want to show the user who edited the page on a company channel. But the smart tags mentioned in confluence Automation smart tags don't work.

**Here is the string I want to build:**

\*Hey Team:\* There is a new update at space \*{{space.name}}\*, on the page \*{{page.title}}\*! You can open the page here: {{page.url}} ! Variables to test: {{user.publicName}} {{user.fullName}} {{user.emailAddress}}  

The first part is working but all smartvalues with user.\* are not shown in the output and they are empty  

**Hey Team:** There is a new update at space **Atlassian Cloud Space** , on the page **Education** ! You can open the page here: URL  
Variables to test:  

It would be great id someone finds out why this is not working


Answers:
author: Stefan Salzl
body: Hi [@Christian Humer](/t5/user/viewprofilepage/user-id/4601042)

Mainly the context of the smart valur refers to the trigger of an automation. Incase of ?edit page" this would be {{page}}. In case of eg. ?user mentioned" it would be {{user}}.  
It seems the user is not in the context/information of the trigger event (if it is native ?page edit" trigger).

You mentioned that you added a webhook. Whwre does your webhook come from? Furthermore could you show your automation rule for further details?

In case you are using a webhook trigger could you please add a ?log action" and log the ouput of {{webhookData}} ? We could then see the payload/data that is sent by the webhook and find out if it contains user information.

Best  
Stefan

comments: author: Christian Humer
body: Hello Stefan  
The webhook is comming from Slack. The audit log function is allready added and the values are empty.


author: Christian Humer
body: ![Screenshot 2023-06-23 111010.png](https://community.atlassian.com/t5/image/serverpage/image-id/264708iA89BE47239DFA4D6/image-size/large?v=v2&px=999 "Screenshot 2023-06-23 111010.png")


author: Stefan Salzl
body: Hi [@Christian Humer](/t5/user/viewprofilepage/user-id/4601042)

I can see you are using a slack action/sending a slack message but I can't see that there is an incoming webhook that triggers the rule and contains of any further information regarding the event.

As far as mentioned in my previous post and as I understand the documentation the ?actor" (user that edited the page) is not contained in the event/trigger object.

(similar to other triggers eg. in jira there is the ?issue transition" trigger - the context/scope is the transitioned issue {{issue}} but as far as I know it doesn't contain the user who did the transition).

Guess that would need further actions calling the RestAPI to eg. find out who did the last change.

Best  
Stefan


author: Christian Humer
body: Hi Stefan  
I think it's like you say. Attached you can see the incomming webhook config

![Screenshot 2023-06-23 124434.png](https://community.atlassian.com/t5/image/serverpage/image-id/264716i00DF3D996E05E66A/image-size/large?v=v2&px=999 "Screenshot 2023-06-23 124434.png")


author: Stefan Salzl
body: Hi [@Christian Humer](/t5/user/viewprofilepage/user-id/4601042)

got it. The term "incoming webhook" was a bit confusing for me. What you show is the webhook for slack. So in context of slack it?s incoming but from the perspective of jira/automation rule it?s an outgoing webrequest. The incoming webhook in Automation4Jira is a trigger. This could fetch requests/events from other 3rd party apps/apis to trigger an automation rule. So this request won?t deliver any needed information (user).

Please let me/the community know if you have any further questions. In case you question has been answered already please consider to hit the accept button in order to mark this question as solved. This will make it easier for other users to find an appropriate solution when faced with similar problems.

Best  
Stefan


author: Trev Angle
body: Hi [@Christian Humer](/t5/user/viewprofilepage/user-id/4601042) if you would like to access info about the page author you can do so with the {{page.author}} smart value. For example, {{page.author.publicName}}.

Like [@Stefan Salzl](/t5/user/viewprofilepage/user-id/4616993) said, the {{user}} smart value is only available in rules with the "User mentioned" trigger.


author: Christian Humer
body: Hi thanks for the answer. But this smart value shows me the value for the original creator of the page and not the value from the user who edited this page


author: Stefan Salzl
body: Hi [@Christian Humer](/t5/user/viewprofilepage/user-id/4601042)

so it seems not that straight forward. What I could imagine is to send a webrequest agains confluence REST API with the pageID you get from your trigger with the smart value {{page.id}} against the following endpoint:

<https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-id-get>

and then check/filter the response.

Unfortunately I can?t test this as I don?t have premium version of confluence and the aclsandbox doens?t grant permission to call the RestAPI.

Nevertheless I hope I could give some inspiration to move forward with this problem.

Best  
'Stefan


Tags: automation

cloud

confluence-cloud

user