Updating Issue's sprint: Finding a string Value in Webhook response

Kaysaff Tal April 14, 2023

Preview

after reading many wonderful post here, i decide to share my solution to the problem of assigning Story to a specific sprint (not 'Next') enhance by cloning the story and moving all Sub tasks that are not in StatusCategory Done 

Rule Trigger: A comment in the main comment ' Split: [Sprint_Name'

Strategy:

1. Parse Latest comment and find the Sprint Name (why name?!, as the team leader          see it, I didn't want to update the rule for every Sprint ID)

image.png

 

2. Setting a variable (and a log) for capturing the the Comment

image.png

3. one last tweak for preatify

image.png

And I have the Assigned sprint name in a variable to use later.

 

4. After much research, i saw no solution how to get Sprint ID according to name, basically I was lookin for get SprintI D by Sprint Name logic.

I solved the problem by adding a web request to an End point in Jira

after playing with Postman for a couple of minutes(authentication mainly - ended up using basic. I am a Jira admin so creating API key was easy), the GET was complete and legitimate response.

BOARD ID is visible in the board public url  - making this dynamic will be the next phase for now it will be hard coded

image.png

I validated the response (also in Postman) and on to Phase 3... extract the Key-value for sprintName and Sprint ID

 

3. Parsing the Web response is where i got stuck for 2 days. read every documentation on smart value and lists - didn't understand it. smart values and JSON didn't help

and I assume Some one can help me here, because i dont have a plan. 

after cleaning a bit in VS code

image.png

What is need is how to look for a string: Sprint_2_id within the web response, and get the matching sprint name (sprint names are unique between board)

Any on can help??

 

1 answer

1 accepted

0 votes
Answer accepted
Sebastian Mondry
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 20, 2023

Hi there,

Great work so far :) !

You can indeed achieve what you're after. 
So, after you've fired the Webhook, create a New Branch component and select Advanced Branching. 
For the Smart value, provide {{webResponse.body.<name of attribute containing the list>}} and assign it a variable name, such as Sprint. 

Then, create an Advanced compare condition, whereby;
First value: {{Sprint.id}} 
Condition: equals
Second value: "sprint_2_Id"

Then, you can access all required Sprint names, e.g. Log Action {{Sprint.name}}.
Hope that helps ~

Kaysaff Tal April 27, 2023

@Sebastian Mondry Amazing, thanks for ur help. 

II see a lot of people struggling with the issue i managed to solve any particular forum to share the initial problem and solutions? 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events