Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,448
Community Members
 
Community Events
184
Community Groups

'Create page in Confluence' automation action. How to set page contents?

Edited

Within the 'Create page in Confluence' action, I see no field to set the contents.

Must this all be done via a template?

If so how would I go about setting up a template that would set its content's to be equal to a Jira ticket's custom field contents?

1 answer

0 votes
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Aug 16, 2022

Hi @Ben Greene 

At this time, the content must be set via a template. This restricts how much information can be inserted into the page at creation.

If you are wanting to have more configurable options of content, there are other approaches using web requests to create content in Confluence.

Have a look at this community post, hopefully it can help you build the rule are wanting

Cheers
Sam

Hi @Sam Harding 

Thanks for the reply.

I essentially want to copy the contents of a select few Jira Custom Fields as the contents for the Confluence page I would create.

Is that something that Templates can achieve, or would I need to use a web request?

@Sam Harding I went with the linked post, but am getting this 500 Internal Server Error when attempting to validate my web request.

The full payload message:

{
"statusCode": 500,
"message": "org.codehaus.jackson.JsonParseException: Unexpected character ('H' (code 72)): was expecting comma to separate OBJECT entries\n at [Source: com.atlassian.plugins.rest.common.limitrequest.jersey.LimitingRequestFilter$1@794c9cbb; line: 3, column: 18]"
}

Also my Custom Data in case that helps:

{
"type":"page",
"title":"{{issue.Issue Title (Short description + Error text)}}",
"space":{"key":"DOC"},
"body":{
"storage":{
"value":"{{issue.Issue Reason + Screenshot(s)}} {{issue.Issue Solution + Screenshot(s)}}"}
}
}

 

I'd appreciate if you could help me spot what I might need to change to get this working 🙏

@Sam Harding this issue is a decently big blocker for us, would you be able to loop in someone who can help with this if you are not able to?

@Sam Harding bumping the above query.

Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 05, 2022

Hi @Ben Greene 

 

Apologies for the delayed response. To answer your questions:

Is that something that Templates can achieve, or would I need to use a web request?

This is something you would need to use a web request for, as you are doing.

am getting this 500 Internal Server Error

It would appear that the JSON data being sent to the API is considered invalid JSON (despite what you have pasted being valid). I suspect this is due to the values being injected by the smart values. Can you print out what this smart value is in the audit log

"title":"{{issue.Issue Title (Short description + Error text)}}"

If I am reading the error correctly, I would suspect the title contains text with a quote character followed by an H like so

"H...."

When smart values prints it out, it will cause the json block to incorrectly formatted. You can try to fix that by using `asJsonString` on your smart value, like so:

{{issue.Issue Title (Short description + Error text).asJsonString}}

 Hope that helps,
Sam

Thanks for the reply @Sam Harding , sadly it still seems to break.

 

Result from logging that value prior to adding .asJsonString:

 

Result from logging that value after adding .asJsonString:

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events