Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding announcement banner via API on customer portal in JSM Cloud

Jakub Nowicki November 15, 2024

Hello dear Atlassian Community!

I'm trying to set announcement banner via REST API on customer portal. 

 

Unfortunately, I couldn't find any official Atlassian documentation. From what I've managed to determine, we can retrieve information about it, but I'm unable to update it.

GET:
https://{sitename}.atlassian.net/rest/servicedesk/1/servicedesk-data/announcement/portal/{portalID}
Returns:

{ "header": "", "headerWiki": "", "message": "", "messageWiki": "", "canEditAnnouncement": true, "canAdministerProject": true, "portalId": {portalID}, "portalProjectKey": "", "translations": { "en-US": { "header": "", "message": "" } }, "defaultLanguageTag": "en-US" }

POST:
https://{sitename}.atlassian.net/rest/servicedesk/1/servicedesk-data/announcement/portal/{portalID}

json data:

 

{ "header": "Test", "message": "test2" }

Returns:

{ "errors": [ { "errorMessage": "sd.portal.announcement.update.bad.request" } ], "reasonKey": "sd.portal.announcement.update.bad.request", "reasonCode": "400" }

Do you know if that's possible to do so?

2 answers

1 accepted

2 votes
Answer accepted
Kai Becker
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 29, 2024

Hi @Jakub Nowicki 

it is possible to update the banner via rest api. 
@Marc - Devoteam is right, that there is no documented endpoint, but nevertheless it is possible. You were almost there. The missing part with your JSON is the outer part.

The message and title need to have a relation to the language of the portal. For example for my project I need to set the translation to EN:

{
"translations":
{
"en-US":
{
"header": "Test",
"message": "test2"
}
}
}
Jakub Nowicki November 29, 2024

You are a genius! It worked. Thank you!

Like Kai Becker likes this
Jakub Nowicki December 2, 2024

Hello @Kai Becker 

I got another interesting question - do you know how to set the main banner on the customer portal via REST API? I mean the banner that is visible in the view of all Service Desk portals.

Thanks in advance for your reply.

Kai Becker
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2024

@Hi @Jakub Nowicki 

sadly I couldn't find anything related setting these global banners.
Looks like this has been rebuild when the whole multi helpcenter part got implemented.

Sorry about that.

2 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2024

Hi @Jakub Nowicki 

There is no endpoint on the API for this.

The data you got is based on viewable data.

But the api docs don't mention an endpoint on this; https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#jira-cloud-platform-apis 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events