Answers: <p>Sure, utilize GitLab API within your CI/CD pipeline to update the ticket status automatically:</p>
  <ol>
  <li><p>Set up a GitLab CI/CD pipeline to run automated tests whenever a new merge request is created or updated. If the tests pass, the pipeline can automatically update the associated ticket status to &quot;Code Review&quot;.</p>
  </li>
  <li><p>Configure GitLab webhooks to trigger another pipeline when a deployment is made to the QA environment. This pipeline will run automated tests again, and if they pass, the associated ticket can be updated to &quot;Ready for Testing&quot;.</p>
  </li>
  </ol>
  <p>Top it off with some GitLab permissions to restrict access to changing ticket status to authorised users only.</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-03-01T00:14:43.587Z
Answers: 2023-03-01T00:14:43.587Z
Answers: wowbagger
Body: <p>In Gitlab we have a flow where our tickets go from &quot;In Progress&quot; to &quot;Code Review&quot; when an MR is created and from &quot;Code Review&quot; to &quot;Ready for Testing&quot; when a deployment to our QA environment is performed. However, the developers have to update the tickets by hand. Each of those statuses (In Progress, Code Review, Ready for Testing) are just tags on the ticket</p>
  <p>Is there a way to automate this flow?</p>
  
Tags: <gitlab><cicd>
Title: In Gitlab is there a way to automatically change a tag on a ticket when an MR is created and/or when a deployment is completed
UserDisplayName: Agreene
ThreadText: # In Gitlab is there a way to automatically change a tag on a ticket when an MR is created and/or when a deployment is completed
  
  (Asked by: username_0 on 2023-02-24)
  
  In Gitlab we have a flow where our tickets go from "In Progress" to "Code Review" when an MR is created and from "Code Review" to "Ready for Testing" when a deployment to our QA environment is performed. However, the developers have to update the tickets by hand. Each of those statuses (In Progress, Code Review, Ready for Testing) are just tags on the ticket
  
  Is there a way to automate this flow?
  
  **Tags:** gitlab, cicd
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-03-01. Score: 1
  
  Sure, utilize GitLab API within your CI/CD pipeline to update the ticket status automatically:
  
  1. Set up a GitLab CI/CD pipeline to run automated tests whenever a new merge request is created or updated. If the tests pass, the pipeline can automatically update the associated ticket status to "Code Review".
  2. Configure GitLab webhooks to trigger another pipeline when a deployment is made to the QA environment. This pipeline will run automated tests again, and if they pass, the associated ticket can be updated to "Ready for Testing".
  
  Top it off with some GitLab permissions to restrict access to changing ticket status to authorised users only.
  
  
  ---
  
  