Post Function or Automation

Mariam Hovhannisyan November 3, 2022

Dear Community,

We use many automations and post-functions in the system. Because of all this, my project started loading with great difficulty.
Please help me understand, in my project, do you optimize automations or post-functions?
What caused the load on my system?
Also, please tell me how automations and post-functions work.

Best Regards,
Mariam

4 answers

1 vote
Mariam Hovhannisyan November 15, 2022

Dear @Nic Brough -Adaptavist- ,
Dear @John Funk 
Thanks a lot for your help and information. I am sure it can help me to fix our issues )))

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 3, 2022

Hi Mariam,

I can't tell you why the load happened on your system, but I don't think it's the automation rules or the post functions. It might be the complexity of the workflow itself in terms of the number of statuses/transitions or it could even be the number of custom fields you have created. Or something related to your browser. All of that is hard to say in the Cloud.

Generally, I like to use Automation rules for most post function type stuff. Mainly because I can implement one universal rule that applies to multiple projects/workflows. Otherwise, I have to add the post function to every workflow used in the workflow scheme and potentially multiple workflow schemes. 

And, I get an error message emailed to me when something fails. Otherwise I have to go into the workflow and see if there are any errors. 

I use post functions when I am using a single workflow across multiple projects, however, as this cuts down on the number of multi-project/global rules that get executed in a month. If you aren't using a Premium Jira subscription, these can add up. 

I would suggest you check your automation rules so that they are designated to a single project as much as possible. And make sure all of your custom fields have a context applied to them by either associating with a project or an issue type or both. 

0 votes
Nic Brough -Adaptavist-
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.
November 3, 2022

You should, absolutely, minimise the use of automation and post-functions.  On a technical level though, I'm not saying you should not use them when they help your people get stuff done.

They all impose load when they run, so you want to be optimising the way they do stuff.

In performance terms, post-functions are way better than automations when it comes to them being triggered.  A post-function only runs when a user uses a transition, but automations are looking out for a huge range of possible triggers and always running code that says "should I do the rest of the stuff in this automation?"

But you can create post-functions and automations that impose a lot of load when triggered as well.  It's entirely possible that running 10 efficient post-functions will impose a lot less load than 1 complex or inefficient post-function.

So, optimisation is a complex process.  For both post-functions and automations, you should look at:

  • Do we really need it?
  • How complex is it?  
    • Is it trying to do too much?
    • Does it use inefficient searches?
    • Is it coded well?

I have a simple example - one of my old colleagues wrote some scripts that run as post-functions.  He is not a coder, and he did the scripting because no one else was available, and was totally honest with the client about "we can do it now, but you really should have a proper coder do it".  When the client asked me to look at upgrading the scripts, the answers to my five questions above were:

  • Do we really need it?  Yes
  • How complex is it?  Very, but it's justifiable because it's really useful
    • Is it trying to do too much?  No
    • Does it use inefficient searches?  Yes
    • Is it coded well? No

One of the scripts stood out as being easily optimisable.  In pseudo-code, his script did:

  • Poorly written search for X issues
    • Do action Y with each one
  • Poorly written search for the same X issues
    • Do action Z with each one
  • Poorly written search for the same X issues
    • Do more things with each one

So optimisation there was to rewrite the script as 

  • Improved search for X issues
    • Do action Y with each one
    • Do action Z with each one
    • Do more things with each one

The same approach applies to Automations and post-functions in your projects - optimisation is checking that you need it, and try to make it run "better" if you can.

0 votes
Mariam Hovhannisyan November 3, 2022

Explain to me the difference between automation and post function and the working principle.
Thank you

fdehne May 14, 2024

Hey,
a post function is part of the workflow and triggered right after an issues has transitioned into a state. An automation can have different triggers and can be very complex.

cheers

Suggest an answer

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

Atlassian Community Events