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

Automating a put request

Aksh Patel May 16, 2024

Hi, I am trying to connect a Custom Process Step in Jira Align with a Custom Jira. The plan is to connect a state in a Jira Feature Or Epic with a Jira Align Feature. The proposed plan is to use python and get the step in Jira as well as the Jira Align Feature that it is linked to. Then go to Jira Align and send an update moving the Custom Process Step. I have two questions;

1. How would I send an update or put request using python (The link is always changing and the Feature ID (I can try to pass this field in so not too worried about this). I am thinking about using a CURL command but the link is always changing. 

2. Is this possible as I have been trying and am stuck now. I can send a put request using postman but that is when all the data and fields are entered (just a solo situation)?

1 answer

0 votes
Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2024

The answer to your question is quite complicated, so I first want to make sure that you know that Jira Align can be set up to automatically sync Jira's work flow Status bidirectionally.  This Jira work flow status will also be mapped to Align's "State" field, so that field would potentially also change when a new Status is synced from Jira for a Feature. 

 

Screenshot 2024-05-17 at 7.04.03 AM.png

Jira

 

----------------

 

Screenshot 2024-05-17 at 7.00.45 AM.png

Jira Align

Aksh Patel May 20, 2024

Hi, yep I am trying to sync the process step with a state in an Jira Feature. The process step should not be synced with the state in Jira Align

Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 21, 2024

I don't have a Python example.  You mentioned PostMan so maybe this snippit from Postman will help.  Note the use of PATCH rather than PUSH allows you to specify the fields you want to update.

Screenshot 2024-05-21 at 6.15.12 PM.png

 


var body = new Array();
body.push({op: "replace", path: "/processStepId",
value: pm.variables.get("myIssues")[pm.variables.get("myIndex")].originalStep})
body.push({op: "replace", path: "/state",
value: pm.variables.get("myIssues")[pm.variables.get("myIndex")].originalState})

console.log(body);
pm.variables.set("myRequestBody", JSON.stringify(body));
Aksh Patel May 22, 2024

Not sure i am understanding this right but if i wanted to change the processstepId to in progress from not started, would your code do that? How do i change it to specific states? 
thank you for all the help 

Allan Maxwell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 22, 2024

Yes, the sample code sets both the processStepId and State.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events