I have a feature I want to add, but see that I could implement this using either the ScriptRunner Scripted Field, or Listener. I am not sure how to determine which would be the better feature to use. This is what I am doing.
For issue type A, B and C, when an issue is updated/created, I want to retrieve the Priority and Created Date. Based on the Priority, I want add a certain number of days to the Created Date, and set the new date in the New Date field. The New Date field is not editable by the users, read only so only on the View Screen.
For example:
- If the Priority is "Critical", I add 2 days to the Created Date, then update the New Date field with that date.
- If the priority value is changed to "High" (Or any other priority value), then the New Date is recalculated and updated.
I have already implemented this using a ScriptRunner Listener and configured the listener to only be for certain projects and issue types and on the Create/Update events. All works perfectly.
However, I believe I can implement the same feature by using a Scripted Field?
My question is, are there any pros/cons with doing it with either Scripted Field or Listener that I should consider before choosing which approach to use to implement this in our production environment?