I set the attachments field to ReadOnly when running a particular transition.
I found a reason.
In the workflow, the properties in that status were set to 'jira.permission.attach.denied'.
Hi @이나은
I have a few questions. Firstly, what version of ScriptRunner and Jira are you currently using?
Second, have you double-checked if the Attachment field itself has been set to read-only in the Field configuration schema, as shown in the screenshot below:-
Also, could you please include a fullscreen screenshot of your Behaviour configuration so I can get a better understanding and try to provide a better solution?
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Image upload is not possible due to company security policy. Please excuse me.
I also checked the field configuration, and it is set exactly like the image you uploaded.
Also, the Attachment field is editable when in a different state, but it's changing to ReadOnly when I run a specific transition (the 171 transition specified in the script).
I already deleted the Behaviour that I set up at the beginning.
However, to explain Bahaviour configuration at the time, it is as follows.
After creating a Name, Description.
Set up the following scripts in Initialiser.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @이나은
Could you please clarify what version of Jira and ScriptRunner are you currently using?
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Open web dev tools and press the transition so you get the transition screen popup.
Your browser should send a POST similar to /rest/scriptrunner/behaviours/latest/validators.json?issueId=5367087&actionId=41&ignoreInitialiser=false
Can you paste the response? It should contain whatever behaviours are affecting that screen, my aim is to find out whether there are any behaviours at all (in which case, we would know the behaviour ids), or if there are none at all - in which case, the readonly is not caused by behaviours.
I might be wrong here, but I don't think behaviours care about browser cache, nor are they really cached on server per se. Any change to behaviours should come into effect immediately. I would imagine the browser just calls for behaviours for the action, and if there are any, it will then get the response and use it to apply some javascript to the page, but that just an assumption I never had the need to look into it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Response:
Cache-Control:
no-cache, no-store, no-transform
Content-Length:
2762
Content-Security-Policy:
sandbox
Content-Type:
application/json;charset=UTF-8
Date:
Thu, 14 Sep 2023 01:16:25 GMT
Referrer-Policy:
strict-origin-when-cross-origin
Server:
Strict-Transport-Security:
max-age=31536000
X-Arequestid:
616x28925x1
X-Asessionid:
boczw7
X-Ausername:
jirauserid
X-Content-Type-Options:
nosniff
X-Frame-Options:
SAMEORIGIN
X-Powered-By:
ASP.NET
X-Seraph-Loginreason:
OK
X-Xss-Protection:
1; mode=block
If the ReadOnly is not caused by behaviours, then what are the possibilities?
The attachment field changes to ReadOnly when the transition is executed, and it is editable when the issue is in a different state.
There is nothing set for the Attachment field in the post function or other operations that run during transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Those are headers, not the actual response data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{
...,
"attachment": {
"readonly": false,
"fieldType": "com.atlassian.jira.issue.fields.AttachmentSystemField",
"displayName": "첨부 파일"
},
"issueTypeId": {
"fieldOptions": [
...
],
"fieldType": "com.atlassian.jira.issue.fields.IssueTypeSystemField",
"displayName": "이슈 유형"
}
}
Attachment's readonly is false.
(Other items were omitted due to in-house security rules.)
It's still turning into ReadOnly, but I don't know why.
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.