Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,026
Community Members
 
Community Events
184
Community Groups

Status Property is blocking Transition ScriptRunner Post-Function

Edited

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:

  1. Update the Created custom date time field at some previous point.
  2. When transitioning to the final status (in my case - Closed)
    1. Update the Finish Date custom date time field
    2. Run ScriptRunner post-function to get values from Created, and Closed, calculate the difference and update the short text custom field with the result.

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!

1 answer

The issue might be with the screen that is set to appear on that transition. I am currently testing that.

No, seems like the issue is not with the screen.

Suggest an answer

Log in or Sign up to answer