Help determining Smart Value name

Fred Deichler March 10, 2021

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
Fred Deichler March 11, 2021

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
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 10, 2021

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

Fred Deichler March 10, 2021

Thank you for your response @Ravi Sagar _Sparxsys_ ,

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}}
Fred Deichler March 11, 2021

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
AUG Leaders

Atlassian Community Events