Comments
-
Hi Mel, This requirement can be achieved by adding a Simple Script condition onto the Workflow which checks 2 check-boxes and says that both check-boxes must have more than 1 value in order for it to display the transition. I have attached some sample code below where I have configured this on a sample workflow by placing…
-
Hi Sherri, Behaviours only works on the create and edit screen of issues and by limitation does not work when a field is in-line edited. One workaround for this issue is to apply some JavaScript to the field to disable in-line editing for the field on a project level. I have attached an example of some JavaScript that can…
-
Hi Kevin, Using the issue.assigneeId method expects the ID of the user as a paramater and not the username of the user as described here. What you should look to do is to get a new user object for the user and set this using the issue.assignee method as shown below. import com.atlassian.jira.component.ComponentAccessor//…
-
Hi Mel,I am glad the solution works. Thank you for accepting the answer.Kristian
-
Hi Mel, Assuming your Client and relevant entities fields are of the Select List type then you could use code similar to the example below in order to achieve your requirements above. The example below was created using JIRA 6.4 and Script Runner version 4.1.3.7. import com.onresolve.jira.groovy.user.FormField// Get the…
-
Hi Syed, You could use the Clones an Issue and Links post function provided by Script Runner with the code shown below in the additional issue actions box and the configuration shown in the screenshot below. // Required Importsimport com.atlassian.jira.component.ComponentAccessor;import…
-
Hi Rahul, I have looked into this issue for you and unfortunately it is not possible to restrict the list of issue types using the Behaviours module of ScriptRunner out of the box. The closest you can do is to set just one issue type based on a users role or group as described in the documentation here. However I have…
-
Hi Chris, Is this issue with the scripted field containing cached values for the issue. If so you may want to add the following code below the import statements for the scripted field in order to disable the caching of values for the scripted fields on issues. enableCache = {-> false} More information can be found in the…
-
HI Saravanan, The code below shows how to make a multi line text field mandatory when a select list has had an option selected using behaviours. As the value will always change to another non value this will ensure that the multi line text field stays mandatory when the select list value field is updated on the create or…
-
Hi Havier, I have looked into this for you and the Multi Select List field of insight is of the type Labels as shown in the screenshot below. Unfortunately the Behaviours add on from ScriptRunner does not support adding labels as it cannot access the LabelManagers class of the JIRA API. I would suggest contacting Insight…
-
Hi Oliver, Im glad I was able to help. Kristian
-
Hi Oliver, Can you please advise if you placed the post function as the last post function in the list on the create transition. Also can you please share with us the following items below so that we can look to replicate and troubleshoot this for you: * The code that you have configured in the post function along with a…
-
Glad I was able to help. If this problem has been resolved can you please mark the answer that worked as accepted so that other users can easily find the solution in future. Thanks Kristian
-
Hi Begona, You should creaate a seperate behaviour for the one project that the field is required. This will be a more stable approach and will not break if any apis change in future. Kristian
-
Hi Begona, You can achieve your requirement using the behaviours module of the ScriptRunner plugin by following the instructions below. This does not require any groovy code to be written and can be achieved by using the built in functionality provided by Behaviours. Steps: * Add a new behaviour and a mapping to the…
-
Hi Sunil, Is this issue due to the Script fields returning cached values. If so you can force values to dynamically be refreshed each time a field is called by adding the line enableCache = {-> false} to the top of your script. Further information on caching for Scripted Fields can be found here. I hope this helps. Thanks…
-
Hi Christian, You should look at the answer provided on the question here by Jamie which should give you the code that will enable you to detect if the field value has changed during in the transition. You could then modify the if condition to only add the comment if the values are different. I hope this helps Kristian
-
Hi Christian, As i have not heard back from you recently i have attached an example script for a post function that will take the value out of a Text Field and add this as a comment on the issue during the transition. This code could be modified to take the values from other fields apart from text fields if required. Code:…
-
Hi Christian, I can confirm that this requirement can be accomplished by the ScriptRunner plugin. Could i please check if you wish to do this in a workflow post function or when a field is updated on the create and edit screens using the Behaviours module of ScriptRunner? Thanks Kristian
-
Hi Kevin, Yes with Checkboxes you can select more than one and the Pipeline field will only be made required when just the feature tracker option is selected. You will either need to change the field to be a Single Select List if you wish to only make the pipeline field required when Factory Tool is selected or you will…
-
I have tested the code above using JIRA 6.3.5 and ScriptRunner 3.0.16 and confirm that it works as expected. If further assistance is needed please provide screenshots of the error as well as an extract of the atlassian-jira.log file. Thanks Kristian
-
Could you please try using my modified code above which I have incuded below as this is the correct syntax for checking check-box values inside of Behaviours. // get a pointer to my checkbox fielddef blockedCf = getFieldByName("Factory Tool") // Get the blockedCf value as a stringString blockedCfValue =…
-
Can you please provide all of the other details requested as well as at the moment we are unable to replicate your issue. Thanks Kristian
-
Can you please confirm what version of ScriptRunner and JIRA you are using as well attach a screenshot of how you can configured my code above. I have tested this on my instance and get no error thrown on my system. Also can you confirm if any of the fields referenced in this behaviour are used by any other behaviours or…
-
Hi Kevin, I have updated my example script above so that it now shows how to make a field required when a check-box is set to certain value. This script was developed using JIRA 7.1.0 and ScriptRunner version 4.2.06. I hope this helps. Thanks Kristian
-
Hi Kevin, I am assuming that the field you are checking the value of is a checkbox field and so have enclosed a sample script of how you make a field required based on the value of a select list based on your example above. This behaviour should be configured on the blockedCf field. // get a pointer to my checkbox fielddef…
-
Hi Rex, I have changed my validator above to be as per the code below and it works with JIRA 7. if (issue.getIssueType().name == 'Bug' && cfValues['DemoSelectList']?.value == 'Capital'){ return false}else { return true} It looks as if you are not calling the getIssueType() which is the correct method to use for JIRA 7.…
-
Hi Teju, This code is for a validator and you cannot set values in a validator. You would need to use a post function to set the field using the Script Post function option you mentioned above. You can find more information on post functions here. If you need further assistance can you please raise a separate question.…
-
Hi Rex, Unfortunately when a field is changed it needs the fields need to be clicked in again for the change to be recognised and fired. Unfortunately this is a limitation of the behaviours plugin and is something you will need to put up with if you follow the behaviours approach. Thanks Kristian
-
Hi Rex, You may want to look at checking the issue type using code similar to below and move this to the behaviour to be on the issue type field. // Required Importsimport com.atlassian.jira.component.ComponentAccessor// Get a pointer to my fieldsdef issueType = getFieldById("issuetype")def selectList =…