I have a post function that sets a field in JIRA and it all works correctly. It shows in the activity log that the field is set, but if you look at the ticket view or edit screen it is still blank. Then after about 10-15 minutes it finally updates and shows the correct value. This causes a lot of issues because I want to fast track certain issues to be resolved based on this field, but can't. What is going on here and how can I fix it?
I'm betting this has to do with indexing in Jira. So Jira Server is at least using lucene indexes of all your issues in order to help with both searching, but also with field data you can see in Jira. When an issue is updated in Jira, there tends to be an automatic reindex scheduled of that specific issue.
My theory is that what is happening is that the issue is updated, a reindex post function is fired, the issue is reindexed based off the data in the database at that exact time, and then after those steps happen, your other field is getting changed. This can all happen in a matter a few milliseconds to a few seconds depending on the performance of Jira and your database. But if the field is changed in the database level without reindexing the issue, you won't be able to see this change on an issue level in Jira. And Jira's search results would also have a problem for that field as well. BUT the database Jira is using would have been updated.
If I'm correct, I think the solution will be to edit your workflow, and change the order of your post functions to make sure that the call to reindex the issue happens AFTER the field is being changed by your other post function.
Try that.
I think you are probably right. My script is the 3rd post-function, while the re-index is the 6th. I'm wondering if the script is just started and then it moves on to the 4th instead of waiting until the entire script in the 3rd post-function is run. My script is a series of if statements and I have noticed that if it is the first handful of ifs that set the field then it works, but if it is one of the later ifs I run into the issue.
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.