Hi everyone!
I am trying to create a page in confluence and changing the owner to the initiator of the rule.
I think the way to do it is making a web request to the Confluence API with the created page id. I have this request:
I know the authorization, endpoint ... are good because just changing {{initiator.accountId}} with any user id changes the owner.
Anyone has any idea why it is not working? If logged the smart value returns the initiator id just fine.
The error that appears is:
Thanks beforehand!
Hi all!
Update, even changing the smart value {{initiator.accountId}} for {{issue.reporter.accountId}} works.
Im out of ideas!
I have found a workaround, this seems a jira problem.
Creating a variable with the same smart value between """ and then using the variable works:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The symptom you observed is likely caused by one of the many racetrack timing problems that can happen in rules.
Specifically for your case, in the Send Web Request action's Custom Data, the content may be validated before it is fully evaluated to populate the smart values. And, this is why using the Created Variable helped: the expression was fully evaluated before usage in the later action. When there are several things in a dynamic JSON expression, I recommend creating the entire thing in a variable, perhaps named varJson, and then using {{varJson}} as the action's custom data. This can also help diagnose JSON syntax problems.
Two other things I note in your rule which could cause problems:
"title": "{{createdPage.title.jsonEncode}}",
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Asier Vadillo So... I've spent an hour now on this and I'm not sure what's going on 👀
I managed to change the owner in the following scenario:
Note that I've also noticed that changing owner seems to fail when new owner is regular Confluence user/collaborator, and that it works if I set that user as space admin (but now I remembered that I have like billion authorization tokens so that might be the issue there as I could be using the one from account that could/couldn't change page owner).
Hope this could help a bit (I might be able to spend some additional time polishing this in the upcoming days) 🤔
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply. Unfortunately this doesn’t help in our case because we use a template, so deleting the page content isn’t an option. I really appreciate the time you took to respond.
I’m in the same situation as you — I don’t understand why it isn’t working.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.