Script Fields FAQ
Will Guardrails affect my script fields?
Guardrails were introduced in Jira 8.22.2 to limit the impact that re-indexing would have on performance. Generally, this is a good thing for Jira and ScriptRunner.
Script fields shouldn't be affected by safeguards, and you may even see an improvement in performance. Script fields are indexed at the issue level, so the safeguards around comments, change logs, and work logs won't affect a script field's output.
Even if your script field reads from the issue's comments, work logs, or change logs, the information is accessed through the standard Atlassian Java API, which reads from the database not the indexes. For example, the following will load the whole list of comments from the issue, not just the top 500:
import com.atlassian.jira.component.ComponentAccessor
def commentManager = ComponentAccessor.commentManager
commentManager.getComments(issue)
As long as you follow the recommendations on the Script Fields Tips page, your script fields should work alongside Jira Guardrails.
When I use order by
in an Issue Picker scripted field, why are issues not sorted as expected?
Sorting is not an included functionality within an issue picker list. If order by
was permitted in the JQL query it would conflict with the default ordering that Jira applies. This would make things like searching for issue keys difficult or impossible. Therefore, allowing manual ordering would make the search results for the field act inconsistently compared to other Jira fields.
In addition, issues that a user has recently viewed, and that match the query, are taken into account when the issue picker field is empty. This is useful as many users will have recently viewed the issue they wish to select using the issue picker field. If the order by
function is included with this field, it would conflict with the "recently viewed" ordering and negatively impact results.