Answers: <p>At the moment it seems not be possible to update all issues at once using the API and therefore <a href="https://bitbucket.org/site/master/issues/15338" rel="nofollow noreferrer">this issue</a> has been created.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-12-08T20:54:47.260Z
Answers: 2017-12-08T20:54:47.260Z
Answers: 030
Body: <p><strong>Background:</strong> There are multiple Bitbucket Repository Issues (BRI). If an issue needs to be edited then an edit button could be clicked and several items, e.g. title and priority could be changed. This works well when some issues need to be changed, but when more than 250 issues need to be changed this approach is tedious.</p>
  
  <p><strong>Aim:</strong> to update all BRI at once.</p>
  
  <p><strong>Method:</strong> The current method is to update the issues manually, but when multiple issues need to be updated then it is time consuming. Another approach could be using the API.</p>
  
  <p><em>Consulting the API:</em> <code>curl -X POST -u "&lt;TOKEN&gt;" https://api.bitbucket.org/2.0/repositories/&lt;username&gt;/&lt;repository-name&gt;/issues?</code> did not return any issues.</p>
  
  <p>In order to update all the issue the following was tried:</p>
  
  <pre><code>curl -H "Authorization: Bearer &lt;access-token&gt;" https://api.bitbucket.org/2.0/repositories/&lt;username&gt;/&lt;repository&gt;/issues -d "priority=trivial" -X POST
  </code></pre>
  
  <p>Instead of updating all BRI, the following was returned:</p>
  
  <pre><code>{"type": "error", "error": {"fields": {"title": "required key not provided"}, "message": "Bad request"}}
  </code></pre>
  
  <p><strong>Discussion:</strong> As mentioned in the method section, perhaps the API could be used to close all BRI at once, but according to the <a href="https://developer.atlassian.com/bitbucket/api/2/reference/resource/" rel="nofollow noreferrer">API documentation</a> there seems to be no update option.</p>
  
  <p><a href="https://i.sstatic.net/7F1Lf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7F1Lf.png" alt="enter image description here"></a></p>
  
  <p><em>Why create this Q&amp;A on DevOps?</em>: The reason is that the ultimate goal is to close an issue in bitbucket by Jenkins when a pull request has been merged. If updating issues using the API works then that will hopefully work as well.</p>
  
  <p><strong>Conclusion/question:</strong> It is possible to update all BRI at once?</p>
  
Comments: CC BY-SA 3.0
Comments: 2018-01-07T22:56:56.610Z
Comments: Well use a GET request to get all issues, then loop over them and this time POST to update each issue (issue id has probably to be given to update an issue)
Comments: Tensibai
Tags: <bitbucket>
Title: How to update all Bitbucket Repository Issues at once?
UserDisplayName: 030
ThreadText: # How to update all Bitbucket Repository Issues at once?
  
  (Asked by: username_0 on 2017-12-08)
  
  **Background:** There are multiple Bitbucket Repository Issues (BRI). If an issue needs to be edited then an edit button could be clicked and several items, e.g. title and priority could be changed. This works well when some issues need to be changed, but when more than 250 issues need to be changed this approach is tedious.
  
  **Aim:** to update all BRI at once.
  
  **Method:** The current method is to update the issues manually, but when multiple issues need to be updated then it is time consuming. Another approach could be using the API.
  
  *Consulting the API:* `curl -X POST -u "<TOKEN>" https://api.bitbucket.org/2.0/repositories/<username>/<repository-name>/issues?` did not return any issues.
  
  In order to update all the issue the following was tried:
  
  ```
  curl -H "Authorization: Bearer <access-token>" https://api.bitbucket.org/2.0/repositories/<username>/<repository>/issues -d "priority=trivial" -X POST
  
  ```
  
  Instead of updating all BRI, the following was returned:
  
  ```
  {"type": "error", "error": {"fields": {"title": "required key not provided"}, "message": "Bad request"}}
  
  ```
  
  **Discussion:** As mentioned in the method section, perhaps the API could be used to close all BRI at once, but according to the [API documentation](https://developer.atlassian.com/bitbucket/api/2/reference/resource/) there seems to be no update option.
  
  [![enter image description here](https://i.sstatic.net/7F1Lf.png)](https://i.sstatic.net/7F1Lf.png)
  
  *Why create this Q&A on DevOps?*: The reason is that the ultimate goal is to close an issue in bitbucket by Jenkins when a pull request has been merged. If updating issues using the API works then that will hopefully work as well.
  
  **Conclusion/question:** It is possible to update all BRI at once?
  
  **Tags:** bitbucket
  
  > **Comments:**
  > **username_1**: Well use a GET request to get all issues, then loop over them and this time POST to update each issue (issue id has probably to be given to update an issue)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-12-08. Score: 1 | Accepted answer
  
  At the moment it seems not be possible to update all issues at once using the API and therefore [this issue](https://bitbucket.org/site/master/issues/15338) has been created.
  
  
  ---
  
  