Forums

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

How can I ensure quality smart values that are complex?

Hans Polder _Devoteam_
Community Champion
August 2, 2024

In this thread @Bill Sheboy stated some suggestions about maybe using Notepad++ to help build more complex smart values like

{{#=}}0{{#lookupIssues}}{{#if(equals(status.name,"In-Progress"))}}+1{{/}}{{/}}{{/}}

Bill, could you maybe go a bit more in specifics? Which Notepad++ plugin(s) do you use for this? I tried finding something about 'expressions' in my Visual Studio Code but couldn't really find the extension there. Also, I wouldn't know which 'programming language' to select in my VSC to get the right formatting. I tried json and xml but those just return errors.

Any help would be appreciated!

1 answer

1 accepted

3 votes
Answer accepted
Bill Sheboy
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.
August 2, 2024

Hi @Hans Polder _Devoteam_ 

Currently, I am only using JSON plugins with Notepad++ to help with rule writing, expression validation.  

There have been improvements over time in the validation of rules during edit, such as these recent ones: 

IMO, these new features need additional work / validation testing.  I recall other suggestions to add autocomplete to the rule editor for smart value expressions, but given the dynamic nature of rule scope's impact on smart values, I hypothesize that would cause further performance problems in the editor.

 

Several community members have suggested creating VS Code extensions to create another rule editor, and which would allow better version management of rules (via source control tools).  At this time, I do not believe there is a public REST API which would enable such capabilities.  Here is the suggestion to add those endpoints: https://jira.atlassian.com/browse/AUTO-51

Others such as @Darryl Lee have tried to help with documentation and rule parsing outside of Jira: https://community.atlassian.com/t5/Automation-articles/Hacking-Parsing-Automation-Rules-with-JSON-for-Fun-and-Profit/ba-p/1984033

 

I welcome learning others' thoughts on such improvements to the rule editor, or perhaps external tooling to help automation writers.  Thanks!

 

Kind regards,
Bill

Hans Polder _Devoteam_
Community Champion
August 4, 2024

Thanks for all the tips @Bill Sheboy !

I've bookmarked some of the pages you've suggested including the current one - I'll dive into it some more once I get around to it. 

I'm wondering what the differences are between your setup (notepad++ with JSON plugin) and my setup (using VSC). For instance, the script you shared in the linked topic shows red/with problems in VSC:

Screenshot 2024-08-05 083128.png

Bill Sheboy
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.
August 5, 2024

Sorry I was not more clear, as I am only using the JSON plugin to help check formatting but not the automation syntax.  It appears you are getting better highlighting results with VS Code than I was with Notepad++.

I have seen others in internet posts describe using other language plugins which support mustache syntax to help, but none are a good fit for the Atlassian Automation language: as far as I can tell it both extends and varies from the mustache specs I have found.  

Last year I considered writing an old-school, BNF spec for the language, feeding that to a canned parser to build a plugin, but never got back to it.  Maybe I'll get back to that this year :^) 

Hans Polder _Devoteam_
Community Champion
August 5, 2024

Hey Bill,

Thanks again. I'll at least try putting it in VSC for now, to check for obvious errors (and ignore some of the problems shown already). 

And, I'll likely follow your replies to see where you're using these more complex statements to store them for later.

I know what I'll put on my Christmas letter to Santa this year! ;-)

Bill Sheboy
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.
August 6, 2024

Have you tried the community feature to Bookmark posts under the ... menu next to post heading?  Bookmarks will store them in a list accessible from your profile avatar at the top-right of the page.

That may help when tracking useful smart value expressions to provide context and explanation for them.

Hans Polder _Devoteam_
Community Champion
August 7, 2024

Hey @Bill Sheboy ,

Yes, I've been using that already - bookmarked this page already! :)

Suggest an answer

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

Atlassian Community Events