Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Smart Values no corpo POST Edited

Bom dia,

Estou tentando, mas sem sucesso colocar uma variável em um corpo para obter o id de uma conta de usuário do Slack.

 

Estou usando o método users/lookupByEmail e quando insiro o parametro email=value, recebo a respota, porém preciso que o value seja uma variável criada como smart value.

 

Ex.: email={{approvers}}

 

Como faço isso?

Capturar (2).PNG

1 answer

0 votes
Andy Heinzer Atlassian Team May 12, 2021

Hi Marina,

If I understand correctly here, I believe you are trying to get the response of this webhook so that you can use this as a smart value within another automation action.  It sounds like you are getting a response, but need this to be in a format that can be used in Jira's automation.

I can see from your screenshot that you have already created an action to send the webhook.  Ultimately, I believe you will need to create another action in this same automation rule to "Edit issue" and then pass in some value of the response.  In this case, using the smartvalue of {{webhookResponse.body}} will show us the complete json response of the webhook.

However in Jira's automation, we do not want to use the entire json response body here, just the email address.  If we look at the Slack documentation for this REST endpoint over in https://api.slack.com/methods/users.lookupByEmail

And use the automation smart value reference guide over in https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/#Smartvaluesgeneral---webhookResponse--

I believe that we can use a smart value such as {{webhookResponse.body.email}} or possibly {{webhookResponse.body.user.profile.email}}, (since the email address appears to be a child value inside profile which is inside the user object response) in order to see just the email address as a smart value.

One method I recommend for testing this out is to create a test rule that then posts an action to the Jira issue such as "create comment", and include a comment such as:

email test1:
{{webhookResponse.body.email}}


email test2:
{{webhookResponse.body.user.profile.email}}

Then save this rule, make sure it happens after the webhook rule, and then test this.  We should then see a comment on the issue in question when testing this.  If we can see only an email address from either value here, then we know that is the correct smart value to use for any other rule in automation here, such as the "Edit issue" where you can then use that smart value to set an approver.

Try this and let me know if you encounter any problems, or have any questions about this approach.

Andy

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

270 views 8 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you