Comments
-
Hi,Raju, I think all you need to do is not have the plainText part of your first expression whcih means you can do issue.customfield_10073.length >0 to ensure a multi line text field is not empty. I hope this helps. Regards, Kristian
-
Hi Gnabaskar, I can confirm in Jira Cloud behaviours are different as they are written in JavaScript and use the UI Modifications API from Atlassian. You can see in these pages details of all supported fields and API methods. Unfortunately, cascading select list fields are not supported as Atlassian does not help these…
-
Hi Csaba, Unfortunately not as Atlassian does not provide this field as available in JQL in Jira cloud. Regards, Kristian
-
I can confirm ScriptRunner for Jira Cloud only allows importing the packages listed here and does not support importing external packages. Regards, Kristian
-
Hi Mehala, Thank you for your question. I can confirm that it is possible to read in data from external systems or Jira Issues using ScriptRunner for Jira Cloud if the third-party system you want to read in the data from exposes the data via a Rest API. This means to read in the file from Jira Cloud then you would need to…
-
Hi Ingo, I can confirm that inside Jira cloud, validators use the Jira Expression Framework provided by Atlassian. Your code will not work as you must use the syntax for the Jira Expression Framework in your validator. We have some examples in our docs page here that show this syntax. They will help you create the…
-
Hi Zaldy, This error indicates the fuleds being updated cannot be resolved. As the error indiactes they have the ids of customfield_10222 and customfield_10221 so you should reference these as the name of the fields in the put request by making it similar to below. put('/rest/api/2/issue/' + issueKey)…
-
Hi Zaldy, This will likely be because you have a closing } bracket before the else statement that needs moving down in the script. Regards, Kristian
-
Hi Zaldy, Can you try moving the put statement above the logger.info statement, so that is inside the else statement to see if this triggers it. I believe the issue is you set the variable named func_area on line 36 which is inside the else statement then your put request is outside this so this property does not exist…
-
Hi Zaldy, I can confirm that your script has a return block in the final, and the way ScriptRunner for Jira Cloud works is that when a return statement is hit, it will stop the whole script, and this will be the reason the put request below it does not get executed. To solve this, you should either replace the return…
-
Hi Rogerio, This error indicates that there are some required fields or there are some validators that control who can handle the issue. The API will only allow the issue to be transitioned if all required fields have values and if the script user has permission to transition the issue. If the issue cannot be transitioned…
-
Hi Thais, Yes, you can check for certain issue types and I can confirm in the examples here, that the first expression on line 46 shows how to check if an issue type is a certain type such as a story or task. I hope this helps. Regards, Kristian
-
Hi Rogerio, I can confirm we have an example in the documentation here that shows how to transition an issue. I can confirm I have tested this, and it works as expected as long as the transition Id specified is a valid transition in the workflow that could be made through the UI, as only valid transitions that users can…
-
Hi Thais, Thank you for your question. I can confirm that unfortunately validators cannot be configured for only specific screens containing specific fields as the Jira Expression framework from Atlassian, which ScriptRunner for Jira cloud uses to provide validators does not support this. The Jira Expression API has a…
-
HI Derrick, In your code, you do if (changedField.getName() === "customfield_10205") { however customfield_10205 is the ID so you must put the field name here. The name of the field is the text shown above the field on the create screen. Also, in your requestName variable getValue().name is not valid and needs to be…
-
Hi Derrick, Thank you for your question. I can confirm that Cascading select list fields are not supported by Behaviours in Jira Cloud and this will be why your script is not working. With Behaviours, you can only check the change value of fields supported for the view the script runs on, which you can see documented here.…
-
Hi Manish, I can confirm with ScriptRunner that adding an attachment to an issue is possible by calling the Add Attachment API. However, it is impossible to generate a PDF as this would require extra dependencies, which we do not support as we only support using the standard Java 11 packages as documented here. This means…
-
Hi Zaldy, I am glad we managed to assist in getting your script working. Regards, Kristian
-
Hi Zaldy, Thank you for your response. If you add a return statement in your script, I can confirm that it will stop the whole script from running, as this is how the product is designed. This means you should add the return inside your if statement which checks if the approvers field has a value and then this will stop…
-
Hi Patriza, Thank you for your question. I can confirm that in Jira Cloud you can only use the issueFunction() JQL function provided by ScriptRunner on the Enhanced Search page as described in the documentation here. This is due to the way that Atlassian restricts how the JQL functions can interact with their…
-
Hi Tom, I can confirm that, unfortunately, it is not possible with the Jira Expression Framework to check whether a comment is internal or public. This is because in the Comment property, as documented here, Atlassian doesn't provide a visibility parameter that can be checked. I hope this helps. Regards, Kristian
-
Hi Gabriela, I can confirm the Behaviours Feature of ScriptRunner for Jira Cloud feature is the way to do this. We have an example script in our script library located here that will show how to do this, and you can use this as a template to help achieve your requirements. I hope this information helps. Regards, Kristian
-
Hi Zaldy, To stop the script from running, you need to add a return statement in the if statement that way if the condition is met it will not run the script. In your code above you are doing if(AproversName !=null) then return, this means the script will stop when the field has a value and your check should be == null…
-
Hi Lisa, If you use ScriptRunner for Jira Cloud then you can use Behaviours to set the default description template and have this only set the value when the description field does not have a value. We have an example script to show how to do this located here. Please note Behaviours only currently supports Company Managed…
-
Hi Brandon, I can confirm the object object error being returned means the value is an Object, and you need to extract the value out of the object to be able to set this as a String. I have created the example, which you can view here, and this shows how to get the value out of a single Select List field and set it in a…
-
Hi Marcello, Sorry for the permissions issue. You should now be able to see the code publically on the link at https://bitbucket.org/Adaptavist/workspace/snippets/7qXyxX Regards, Kristian
-
Hi Zaldy, Thank you for your question. I would advise wrapping your logic in an If statement, which checks if the AD Manager field value is not null and only tries to copy the value if the field is not null. This error can occur when a field value is null, which is why I would suggest adding this check to the script. I…
-
Hi Manasa, I am glad I was able to help. Regards, Kristian
-
Hi Caimhin, My apologies; I meant to say Custom Field, and I made a typing error in my previous response, which I have now corrected. You could not achieve this on a scripted field due to how scripted fields work, instead, you would have to update a regular custom field daily with a script to achieve your requirement.…
-
Hi Mark, Thank you for your question. I can confirm that it is possible to write scripts that would interact with an external application such as Slack, as long as the application contains a REST API which can be called to interact with it. We have an example in our library script, which you can use as a reference guide…