Hello,
I have noticed a weird behavior. Maybe it is the lack of experience that makes this situation weird for me; however, I have noticed that if you set the following properties for a final status (Closed/Resolved/Done...), ScriptRunner Post-Functions are being blocked. Simple "Update Custom Field" post-function with the usage of %%CURRENT_DATETIME%% is working properly.
Properties that I am setting when the final status is assigned.
jira.issue.editable - false
jira.permission.comment.denied - true
ScriptRunner post-function that is being blocked is used to calculate the difference between 2 custom date time field values and update the custom short text field with the result.
So, these are the steps:
This is the error that I get when properties are assigned to the final status:
2023-05-11 12:52:20.864 INFO - Serializing object into 'interface java.util.Map' 2023-05-11 12:52:20.866 INFO - GET /rest/api/2/issue/SD-48208?expand=names asObject Request Duration: 434ms 2023-05-11 12:52:20.868 INFO - Created - Thu May 11 16:51:58 UTC 2023 2023-05-11 12:52:20.868 INFO - Closed - Thu May 11 16:52:19 UTC 2023 2023-05-11 12:52:20.868 INFO - Difference 21.000 seconds 2023-05-11 12:52:21.103 INFO - PUT /rest/api/2/issue/SD-48208 asString Request Duration: 234ms 2023-05-11 12:52:21.104 WARN - PUT request to /rest/api/2/issue/SD-48208 returned an error code: status: 400 - Bad Request body: {"errorMessages":[],"errors":{"customfield_10171":"Field 'customfield_10171' cannot be set. It is not on the appropriate screen, or unknown."}} 2023-05-11 12:52:21.104 INFO - Serializing object into 'interface java.util.Map' 2023-05-11 12:52:21.104 ERROR - Please use the ScriptRunner user to complete this task not the Initiating User. See https://docs.atlassian.com/jira/REST/cloud/#api/2/issue-editIssue for more information. If you are using the ScriptRunner user then check the Field Configuration 2023-05-11 12:52:21.104 INFO - Run script completed
Thank you!
The issue might be with the screen that is set to appear on that transition. I am currently testing that.
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.