Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
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

Help determining Smart Value name

Hello,

I'm trying to figure out a Smart Value for Jira Automation rule. The rule alerts the appropriate Slack channel when a ticket is transitioned from 1 project to another. It works well, but I would like to include the prior project into the Slack message.

So, I'm wondering if someone can help me determine the Smart Value from the changelog for the items I'm pointing to.

Thanks,

Screen_Shot_2021-03-10_at_10_13_37_AM.png

2 answers

1 accepted

1 vote
Answer accepted

To close this question, I change the rule as I mentioned above and it triggered last night and operated as expected. I need to correct my wording a bit, but that is an easy fix.

The smart value I was looking for was:

{{changelog.project.fromString}}

Screen_Shot_2021-03-11_at_8_29_38_AM.png

The whole Slack message is

*{{initiator.displayName}} moved a {{issueType.name}} from the {{changelog.project.fromString}} Project to the {{changelog.project.toString}} Project*
<https://company.atlassian.net/browse/{{issue.key}}|{{issue.key}} {{issue.summary}}>
*Priority:* {{issue.priority.name}}
*Labels:* {{#issue.labels}}{{.}}, {{/}}
*Reporter:* {{issue.fields.reporter.displayName}}
*Description:* {{issue.description.abbreviate(300)}}
-------------------------------------------------------------------------
1 vote

Hi @Fred Deichler 

I answered a similar question here few weeks ago.

You can use Automation to call Jira REST API with changelog.

JIRAURL/rest/api/3/issue/{{issue.key}}?expand=changelog

 Then you can access changelog like this.

{{webhookResponse.body.changelog.histories}}

You can iterate this using this.

{{#webhookResponse.body.changelog.histories}}
ID: {{id}}
Created: {{created}}
{{#items}}{{fromString}} - {{toString}} {{/}}
{{/}} 

 Which will give you output like this.

ID: 18206
Created: 2021-01-02T17:11:59.730+0000
To Do - In Progress 

ID: 18152
Created: 2021-01-01T16:40:30.859+0000
To Do - In Review

I hope it helps. I know there are multiple steps involves and calling Jira REST API will involving storing Authentication information as plain text which is not ideal.

Or you can also try using ScriptRunner for Jira Cloud where fetching change history and parsing the JSON in Groovy is much simpler and with script you can achieve lot more.

I hope it helps.

Ravi

Thank you for your response @Ravi Sagar _Adaptavist_ ,

I was able to access the changelog status using the following in Jira Automation

{{changelog.status.fromString}}

So, I was hoping to find a similar variable that I could use to get something similar and I think that I was able to accomplish it by really thinking about what you wrote and what I could do, so I think that line I was looking for is

{{changelog.project.fromString}}

To close this question, I change the rule as I mentioned above and it triggered last night and operated as expected. I need to correct my wording a bit, but that is an easy fix.

The smart value I was looking for was:

{{changelog.project.fromString}}

Screen_Shot_2021-03-11_at_8_29_38_AM.png

The whole Slack message is

*{{initiator.displayName}} moved a {{issueType.name}} from the {{changelog.project.fromString}} Project to the {{changelog.project.toString}} Project*
<https://company.atlassian.net/browse/{{issue.key}}|{{issue.key}} {{issue.summary}}>
*Priority:* {{issue.priority.name}}
*Labels:* {{#issue.labels}}{{.}}, {{/}}
*Reporter:* {{issue.fields.reporter.displayName}}
*Description:* {{issue.description.abbreviate(300)}}
-------------------------------------------------------------------------

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Service Management

ThinkTilt is joining the Atlassian Family!

This morning, Atlassian announced the acquisition of ThinkTilt , the maker of ProForma, a no-code/low code form builder with 700+ customers worldwide. ThinkTilt helps IT empower any team in their or...

247 views 14 17
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