Hello!
I have SIL script custom field updated but not visible in search.
Are there some methods to automaticaly reindex issue when return value changes?
Manualy reindex JIRA is not a solution.
Hi Sergey,
The SIL Script CF has multiple searchers available, depending on what type of value it holds. You can go to Administration->Custom Fields and on the "Edit" screen you should be able to choose which type of searcher you want. Note that changing the searcher, the name of the CF or the SIL script behind it requires a reindex. You should normally not need to manually reindex when the value changes, since it is automatically reindexed.
I don't understand if the problem is that the field is not searchable or if the values shown in search are incorrect.
I have this code to change 2 custom fields and return task overdue in SIL fileld.
string format = "yyyy.MM.dd HH:mm:ss"; string[] my_statuses; string[] my_statusHistory = fieldHistory(key, "status"); date my_startDate; date my_endDate; date my_finalDate; for(number i = 1; i < size(my_statusHistory); i = i + 2) { string my_statusStr = getElement(my_statusHistory, i); if (my_statusStr == "3" && isNull(my_startDate)) { my_startDate = arrayGetElement(my_statusHistory, i - 1); } if (my_statusStr == "5") { my_endDate = arrayGetElement(my_statusHistory, i - 1); } } if (isNull(my_startDate) && (customfield_10611 != created)) { customfield_10611 = created; } else if (isNotNull(my_startDate) && (customfield_10611 != my_startDate)) { customfield_10611 = my_startDate; } if (isNull(my_endDate) && (customfield_10612 != customfield_10107)) { customfield_10612 = customfield_10107; } else if (isNotNull(my_endDate) && (customfield_10612 != my_endDate)) { customfield_10612 = my_endDate; } return ((customfield_10611 > customfield_10107) || (customfield_10612 > customfield_10107) || ((currentDate() > customfield_10107) && (customfield_10612 >= customfield_10107)));
SIL field have exact text seacher. But the values shown in search are incorrect. Manual reindex helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What versions of JIRA, keplercf and katl-commons are you using? I'm running into some other problems while trying to reproduce this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
https://jira.atlassian.com/browse/JRA-7809
This explains why searching is not working. It's old, but it still applies.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So the problem goes like this: The script should be read-only. You should not be able to modify the fields from the script and there's a good reason for that. If you modify any field, it will trigger a reindex on the issue. The reindex will try to get all the values of the custom fields (including the SIL script) and will re-run the script, which will trigger another reindex and so on and it should start spinning. We have implemented a mechanism to prevent this from getting into an infinite loop. It surprises me that you say this works (as you said on the other thread) since it does start spinning when I try to reproduce this and it will show an empty value for the SIL script cf.
Unfortunately, I don't see a way to make the search work. The issue will be automatically reindexed when someone updates it or if there's a scheduled reindex. If you try to trigger the issue update from the script, you'll bump into the above problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the problem you are talking about but solved it by updating fields only when they different. And I'll try to solve this task by making another custom field and update its value. I think this will trigger reindex. Am I right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will encounter the problem whenever you modify any field. It works now because you didn't need to update any values yet. Even if we assume this works, it's still not enough since the script will be triggered when the issue is shown (or needed somewhere else). So you'll need to view the issue in order for the indexes to be updated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Think I got answer to my questions. Thank you! Didnt know that scripts triggered only when issue is viewed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could give JJupin a try if you like. It has a bunch of other useful functionalities like conditions, validators, post-functions, services, listeners and more, all based on the SIL scripting language. We're also preparing some really useful new features to work with the issue UI, so stay tuned :)
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.