Hi,
Is the following possible?
When an issue has a set state and a field has a 0 value then add date stamp anther field.
Ie issue in state ‘Closure’ and ‘Open Orders’ Field goes to 0 date stamp add in ‘project Spend Completed’ field
Any help or ideas would be great.
Thanks
Kevin
Hello Kevin.
Yes this is possible, but should it be done? That's the real question.
You can do this two ways:
1. Create a listener
You make a custom listener that registers onIssueUpdated events.
That listener checks the project and issue type relevant to you. If it is you check that the value of your custom field has changed. If it has you check that it's zero, if it's zero you set the timestamp of your other field.
2. Incorporate this behaviour in a scripted field.
You make a scripted field as follows.
But!
Both of this methods are quite heavy on your instance for something that you could do yourself. FE, you can create a REST endpoint that sets a timestamp to a field in an issue. Instead of setting a value to 0, you create a fragment that calls this rest endpoint when clicked.
Same thing, and less performance impacting on your instance.
If you need any help on this let me know.
Cheers!
DYelamos
Hi Daniel,
Thanks for the speedy answer.
The 'Open Orders' is imported information from our accounts system each night.
Could option 3 still work?
Thanks
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You mean that it is ran automatically?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To be honest, if it's updated manually you need to go about this using listeners, if you want to keep it easy.
The more interesting route would be as follows:
Rest endpoint.
So your account systems at some point is calling the JIRA rest api via a script, I suppose.
If that is the case, you must have a list of the issues, or projects that you are updating. You can put that information in a JSON file.
With that JSON file, you can call another REST endpoint that does the calculation for the field, just after you do the import.
The rest endpoint would take that payload, and only do the calculations for the issues/projects necessary.
That is less performance affecting that anything else that I can think of.
Do you need information on how to go about this?
If so check our REST endpoints documentation:
And this answer of mine might help you craft a rest endpoint with authentifiation and JSON payload.
I hope this helped, if it did, please upvote my answer, and if it solved your problem, accept it so other users know this has been solved.
Cheers
Dyelamos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
This give me a lot of great information to go away and consider.
Meny Thanks for all your help
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A pleasure, this would be interesting to do when I'm on support, if you want any help, create a new question and tag me in it. I'd be glad to give you a hand.
Cheers
Dyelamos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.