Is it possible to use Jira automation to transition a ops sub task to DEPLOYED IN PROD.
Asked by Vivek J:

I want to create a Jira automation that automatically deploys an ops sub-task to push Bitbucket changes to production without manual intervention. This automation should run twice a week in scrum board.

The steps for the automation are as follows:

1. Use the scheduler to create a Non-Development Work ticket.
2. Create an ops sub-task linked to the Non-Development Work ticket as the parent issue. Both the task and the ops sub-task need to be visible in the current sprint for visibility purposes.
3. Transition the ops sub-task to 'Ready for Prod' and then to 'Deployed in Prod' (if possible, directly transitioning to 'Deployed in Prod' to trigger deployment).
4. Once the ops sub-task is deployed to production, it should trigger the Bitbucket deployment.
5. Send an email to my team indicating that the automation has been triggered and requesting confirmation.
6. Transition the Non-Development Work ticket to 'Done'.

The screenshot I provided is the automation I tired to make myself, it currently only creates the Non-Development work ticket only, rest of the automation fails. ![IMG_6275.png](/t5/image/serverpage/image-id/347622iE2C68D4B772D0972/image-size/large?v=v2&px=999 "IMG_6275.png")  


Answers:
author: Manoj Gangwar
body: Hi [@Vivek J](/t5/user/viewprofilepage/user-id/5593887) Welcome to the community!

To create this Jira automation for deploying a Bitbucket change, follow these steps. You will need both Jira automation rules and potentially integrations with Bitbucket pipelines or APIs.

Steps:

Create a scheduled trigger:

In Jira Automation, create a rule with the trigger "Scheduled" and set it to run twice a week (e.g., on specific days or intervals).

Create a Non-Development Work ticket:

After the trigger, use the "Create Issue" action to create a new ticket (Non-Development Work).

Set necessary fields like the project, issue type, summary, and any custom fields.

Create an ops sub-task linked to the parent issue:

Add another "Create Issue" action to create a sub-task. Link it to the previously created Non-Development Work ticket using the "Parent Issue" field.

Ensure that both tickets (task and sub-task) are assigned to the current sprint by using the "Edit Issue" action to update the sprint field.

Transition the ops sub-task:

Add a "Transition Issue" action to move the ops sub-task to 'Ready for Prod.'

After this, add another transition to move the sub-task to 'Deployed in Prod.'

If your workflow supports direct transitions, you can combine these into one step. If not, use two transition actions.

Trigger Bitbucket deployment:

Use the "Send web request" action to trigger a Bitbucket deployment via its API or a webhook. Ensure the correct API token and endpoints are used to execute the deployment to production.

Send an email notification:

Add an action to "Send Email" to notify your team. Include key information, like which issue was moved to production and when. Optionally request confirmation from the team.

Transition the Non-Development Work ticket:

After the Bitbucket deployment, transition the Non-Development Work ticket to 'Done' using the "Transition Issue" action.

comments: author: Vivek J
body: Hi [@Manoj Gangwar](/t5/user/viewprofilepage/user-id/4484987), if I use the scheduler to automate the 'send web request' for the Bitbucket deployment, can I skip creating the tasks and ops sub-tasks altogether?


author: Manoj Gangwar
body: Yes, you can skip.


author: Vivek J
body: Hi [@Manoj Gangwar](/t5/user/viewprofilepage/user-id/4484987) we couldn't get the web request to work so I went back to using transitions to deploy the ops sub task, I broke the automation into 2 parts for simplicity. Part 1 is the creation of non-dev work task and ops sub task(This automation works), and part 2 is the transition of the ops sub task I'm getting an error for that I'm not sure how to fix the error do you have any ideas how I can fix this issue that can be seen in audit log. ![IMG_6286.png](https://community.atlassian.com/t5/image/serverpage/image-id/348854iDFF52F89C248241B/image-size/large?v=v2&px=999 "IMG_6286.png")![IMG_6287.png](https://community.atlassian.com/t5/image/serverpage/image-id/348853iF427E025FFB08C9B/image-size/large?v=v2&px=999 "IMG_6287.png")


author: Manoj Gangwar
body: Hi [@Vivek J](/t5/user/viewprofilepage/user-id/5593887)

Please check your workflow, i think there is no direct transition from ready for prod to deployed in prod. If not then add the transition


author: Vivek J
body: Hi [@Manoj Gangwar](/t5/user/viewprofilepage/user-id/4484987) this is my current workflow, based on what I see we don't have the direct transition. Can you show me an example of what the workflow would look like for my automation to work? I don't have access to creating workflow since it's a company managed project, so I would need to send the admin a screenshot of what it should be most likely to see if they can create it. ![IMG_6289.png](https://community.atlassian.com/t5/image/serverpage/image-id/349035i23AAFB76843CCE0E/image-size/large?v=v2&px=999 "IMG_6289.png")


author: Manoj Gangwar
body: Hi [@Vivek J](/t5/user/viewprofilepage/user-id/5593887) workflow looks good. Could you please check if you are able to chane the status from In development to Ready for prod manually?

If ready for prod status transition option is not showing then check with admin there could be some validator Or condition are applied on the workflow.


author: Vivek J
body: Hi [@Manoj Gangwar](/t5/user/viewprofilepage/user-id/4484987) I can change it from in development to ready for prod manually, which is why it's weird that I got that error since I'm trying to move it from in development to ready for prod to deployed in prod, which we have a workflow for.


author: Manoj Gangwar
body: Hi [@Vivek J](/t5/user/viewprofilepage/user-id/5593887) could you please replace the rule actor with your name and then test?


author: Vivek J
body: Hi [@Manoj Gangwar](/t5/user/viewprofilepage/user-id/4484987) it worked once I changed the rule actor to myself, thank you for all the help.


author: Manoj Gangwar
body: Gald to help. Please accept the answer.


author: Vivek J
body: Done, thank you.


Tags: cloud