Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation help with either Reassigning a variable to a {{webResponse}} or Nested IF statement

Metan August 23, 2023

I need help finding a way to check a webResponse. 

I currently have a process that is triggered by a Task that is changed to "Done".  Once that trigger occurs, I check to see IF it is a certain task. IF it is then call the "Send Web Request" function.  I then want to check IF the {{webResponse.Status}} != 200 => Send Email.

Problem is that {{webResponse}} is out of scope... If I create a variable that IS in scope, I cant seem to find a way to reassign it after the Web Request is made.

I also cant seem to create a nested if within the Scope of the WebRequest to check there. 

 Anyone have suggestions or advice?

1 answer

0 votes
Kian Stack Mumo Systems
Community Champion
August 23, 2023

@Metan

 

Can you post a screenshot of your current rule here?

 

Thanks,

 

Kian

Metan August 23, 2023

JiraAutomateBilling.png

Metan August 24, 2023

@Kian Stack Mumo Systems Above is the screenshot

Kian Stack Mumo Systems
Community Champion
August 24, 2023

Thanks, I'll take a look.

Kian Stack Mumo Systems
Community Champion
August 24, 2023

@Metan

 

Thanks for sharing. The issue is that you created two conditions that are "If/Else" blocks. As such, the call you make inside the first If/Else condition block, it will not be available in the next one you try to run.

 

Instead, for the first block, you should pick the Issue Fields condition, and then create a new If/Else block if the conditions passes.

 

It should look like this:

Screen Shot 2023-08-24 at 9.49.00 AM.png

Metan August 24, 2023

but wouldnt the Web Request need to be nested in the first IF block?

else itll do the first IF block, then do what is nested in there (nothing) then continue to do the webrequest

Kian Stack Mumo Systems
Community Champion
August 24, 2023

No.

 

The If blocks don't work quite the same way that they do in a coding language. In a coding language you would need to nest it inside of an if, but the way that the single "If" components work is that if the condition isn't met, the rest of the rule is not processed. Everything that comes underneath the singular "If" is "nested" by definition.

 

Does that make sense?

Thanks,

Kian

Metan August 24, 2023

Wow.. Thats nice to know but weird haha. 

Thank you!

Metan August 24, 2023

@Kian Stack Mumo Systems  Is there a way to reassign a variable already created?

Kian Stack Mumo Systems
Community Champion
August 24, 2023

Within the same context, you should be able to update the variable.

Metan August 25, 2023

@Kian Stack Mumo Systems How though? Do you use the "Create Variable" function and name it the same?

Kian Stack Mumo Systems
Community Champion
August 25, 2023

Yes.

Suggest an answer

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

Atlassian Community Events