Option to automatically set due-date relative to creation-date and priority on Create event

I need to implemenmt this feature:

Set the due-date depending on other factors during creation of issue.

High prio: Due-date = creation date + 1 day

Med prio: Due-date = creation date + 3 days

Low prio: Due-date = creation date + 2 weeks

Any idea on how to get this implemented? Inbuilt (4.2.2) or plugin or ...


2 answers

1 accepted

If it's only for "create", a post-function may be more easy to write?

Well, if it is only create, a listener is easier to write ;) It is just one Java class as opposed to 2 classes plus 2 vm and then workflow configuration!Code is the same.

If it is not just create, i.e. needed on other workflow actions, I will go for a post function.

Just my opinion. Some may find post functions easier.

True, the complexity of the plugin is lower, but the code for a post-function is more simple (last time I converted a post-function to a listener, I think it was about 30 lines of post-function vs 250 in the listener). You've also got a potential load - listeners have to process all events, even if it's just to say "I don't need to do anything", where a post-function only runs when needed.

I'd also be strongly tempted to use the script runner instead :-)

code for a post-function is more simple

Not in my opinion. Listener is pretty straight forward. 30 lines of post-function vs 250 in the listener doesn't look right to me. Maybe you were using the old listeners? Also, post functions has other code underneath.

Even performance wise, listener is better because it runs in a different thread. We are capturing only the created event and the other part of doing nothing for other events is negligible. Again, my opinion only ;)

Scriptrunner is great, no doubt about that, You just need some scripting skills.

Sadly, the load testing we did on 4.3 showed exactly the opposite - it was very clear that listeners impose a significantly heavier load than equivalent post-functions. Yes, they may well be in a different thread, but the numbers were very clear that post-functions are significantly lighter on the system than listeners performing the same tasks. Of course, this was for a large Jira under a heavy load, the effects aren't measurable for small-medium installations (large being >250k issues, >10k users, etc)

interesting. I can't imagine why! Maybe someone else can shed some light on this.

Thanks for sharing though. I always thought listeners were light weight.

So did I, until we'd run through these load tests!

I don't know if it applies to other versions of Jira though, I never went into much detail - the important outcome of the load test was the reassurance that the internal stuff was functionally ok, and we needed to get the users to stop hitting Jira with RSS or Excel downloads with tempmax=10000000 (which they were doing because when Jira tells you the truth about your project not really going anywhere, it's easier to download a huge amount of data and do all sorts of horrid manipulations in Excel to hide the fact you're going nowhere)

Hello Jobin & Nic,

Thanks a lot for your immediate response!

I've hoped to find this functionality in some existing plugin which I could just reuse. ;)

Now I need to check how to write the required code.


Hi Guys, any further luck with such functionality? Code examples, methods, etc?

Hi Guys, any further luck with such functionality? Code examples, methods, etc?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,084 views 4 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you