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

is there any way to add announcement programmatically in JSD customer portal?

Pornima Bhoyar August 13, 2018

On my instance, i just want to add announcement on JSD customer portal whenever a version is released, is there any way to do it programmatically? Any suggestions are welcome.  

1 answer

1 accepted

1 vote
Answer accepted
Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 21, 2018

Hello there! Thanks for reaching out the Atlassian Community!

I was able to find an endpoint to change the announcement message with a REST API call. This is not in the official Jira's REST API, so you should use the following to make the call:

POST /rest/servicedesk/1/servicedesk-data/announcement/portal/{portalId}
  • Header: {'authorization': <basic_auth>,
    'content-type': "application/json"}
  • Body: {"header":"","message":"This is the announcement message"}

You can get the "portalId" by checking the URL when you access the portal in the GUI, it should be the last number in it.

Now, you can create a script that makes this call to change the announcement message. You can also release the version with the script by calling the official API:

PUT /rest/api/2/version/{id}
  • Body: "released": true

Kind regards,
Maurício Karas

Pornima Bhoyar August 24, 2018

Thank you for the reply @Mauricio Karas, can you help me with one more thing. As above mentioned announcement will work on portal page, what if i want to make global announcement?

Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2018

You can use the Announcement Banner(configuration in System > Announcement Banner) to make the text visible throughout the entire instance. Unfortunately, there's no REST API to change it, the only way to change it programmatically would be to change the value directly in the database.

Pornima Bhoyar September 4, 2018

Thank you for your reply @Mauricio Karas, is there any way to authorize private rest api?

Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 4, 2018

Hey, Pornima. 

I'm not sure I got your question, but regarding authentication for the REST API I recommend you to check the following page that shows all available methods that you case use:

Also, so you know, if you're using Jira Cloud instead of Server, the announcement banner feature will not be available.

Kind regards,
Maurício Karas

Pornima Bhoyar September 6, 2018

Ok, thank you so much for your reply @Mauricio Karas . It is very helpful.

Zine ZIDANE
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 11, 2019
Zine ZIDANE
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 11, 2019

solved...just a wrong password :(

Pravin Patil
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 1, 2021

Hello, 

 we were using above mentioned API in our app, but it stopped working and we are getting 404. Recently is there any change from atlassian side in this URL or this REST api not supported now.

/rest/servicedesk/1/servicedesk-data/announcement/portal/{portalId}
Alex
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 16, 2021

Hey @Mauricio Karas 

Thanks for sharing the endpoint for updating the portal announcement banner. I just want to add here that we can also update the Help Center banner using the following:

  • <baseurl>/rest/servicedesk/1/servicedesk-data/announcement/help-center

Example cURL call:

curl -X POST -u username:pass -H "Content-Type: application/json" --data '{"header":"","message":"Help Center message"}' -k https://jira/rest/servicedesk/1/servicedesk-data/announcement/help-center

 Tested on my instance and worked beautifully, thanks @Rodrigo Baldasso !

lucky nath March 28, 2024

Hello @Mauricio Karas 

i am new in JSM ,iam searching for api to get portal announcement, using your given api i get message from portal

GET /rest/servicedesk/1/servicedesk-data/announcement/portal/{portalId}

so firstly,to get portalId i hit api to get service desk id

https://portalname.net/rest/servicedeskapi/servicedesk

and it give me id like this

{
"id": "01",
"projectId": "10101",
"projectName": "exmple-project",
"projectKey": "EP",
"_links": {
"self": "https://portalname.net/rest/servicedeskapi/servicedesk/01"
}
}, so this is : "id": "01", portalid 

i use in api like this:
GET /rest/servicedesk/1/servicedesk-data/announcement/portal/01 

so  i want to know what is 1 after servicedesk/: in this url  /rest/servicedesk/1/  . it help me lot.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events