How to disable notification emails via REST api when restoring Jira archived issues
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Restoring archived Jira issues can trigger email notifications that are unnecessary. This knowledge base article describes how to disable notification email using REST api when restoring Jira archived issues.
Environment
Jira 8.x and later
Solution
The REST API for restoring an issue PUT /rest/issue/{issueIdOrKey}/restore can be modified with a query-parameter ?notifyUsers=false
at the end to disable the email notification on restoring the issue.
1
http://HOST:PORT/rest/api/2/issue/{issueId}/restore?notifyUsers=false
The email notifications will be disabled for the mentioned request and specific issueId only. There will be no impact on other requests.
The snippet below is a sample curl request and response for restoring the issue KAN2-10
without triggering email notifications.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
❯ curl -v -u "sampleUser:samplePassword" -X PUT "http://localhost:8080/rest/api/2/issue/KAN2-10/restore?notifyUsers=false"
* Trying ::1:8080...
* Connected to localhost (::1) port 8080 (#0)
* Server auth using Basic with user 'sampleUser'
> PUT /rest/api/2/issue/KAN2-10/restore?notifyUsers=false HTTP/1.1
> Host: localhost:8080
> Authorization: Basic Y3BhbmRleTphZG1pbmlzdHJhdG9y
> User-Agent: curl/7.77.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 204
< X-AREQUESTID: 532x300x1
< Referrer-Policy: strict-origin-when-cross-origin
< X-XSS-Protection: 1; mode=block
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< Content-Security-Policy: sandbox
< Strict-Transport-Security: max-age=31536000
< Set-Cookie: JSESSIONID=9E9EBA35EE31380DFC37EAB157528E7D; Path=/; HttpOnly
< X-Seraph-LoginReason: OK
< Set-Cookie: atlassian.xsrf.token=BE8V-QK7K-JHAJ-01LP_9f0e4bbf4e0a054ce38b531bbcb07e7062e3cba7_lin; Path=/
< X-ASESSIONID: e9cxm9
< X-AUSERNAME: sampleUser
< Cache-Control: no-cache, no-store, no-transform
< Content-Type: application/json;charset=UTF-8
< Date: Thu, 31 Mar 2022 03:22:10 GMT
<
* Connection #0 to host localhost left intact
Was this helpful?