Comments
-
Hi David, From our release notes, it looks like you'll need to restart your JIRA instance if you haven't done so after installing the version of ScriptRunner that gives you the Automation for Jira integration. Have you done a restart and reset your browser? Thanks, Josh
-
Hi Varun, If you remove the first 'if' statement that checks to see if the issue type is a story, this script should work for all the other issue types. Like this: import com.atlassian.jira.component.ComponentAccessor def issueLinkManager = ComponentAccessor.getIssueLinkManager() def customFieldManager =…
-
No problem. If you plan to write a lot of scripts, you might consider following our "Setting up a dev environment guide" https://scriptrunner.adaptavist.com/latest/jira/DevEnvironment.html#_connecting_intellij_idea_with_the_atlassian_source_code That functionality makes it a lot easier to see which methods are available…
-
Charles, Is this for ScriptRunner for JIRA Server? If so, you should should be able to call getProjectId() on the Version object. import com.atlassian.jira.component.ComponentAccessor def ProjectManager = ComponentAccessor.projectManager def VersionManager = ComponentAccessor.versionManager long version = 23958 def…
-
Hi Varun, I created this script for a script field of type Number: import com.atlassian.jira.component.ComponentAccessor if (issue.getIssueType().name == "Story") { def issueLinkManager = ComponentAccessor.getIssueLinkManager() def customFieldManager = ComponentAccessor.getCustomFieldManager() def storyPointsField =…
-
Kyle is right that there is a bug with this. Though if you are looking for a new add-on, I think ScriptRunner could accomplish this. issueFunction in issueFieldMatch("project = JRA", "summary", "ABC\\-DEF\\-XY001\\-*")
-
Stephen, I think there could be a couple issues in your script. CustomField customField_1 = customFieldManager.getCustomFieldObject("13700"); Is this really the id of your custom field? Could you try using the field name instead of the ID, like this: customFieldManager.getCustomFieldObject("yourFieldNameHere"); It also…
-
Hi Todd, In your version of ScriptRunner, inline editing is automatically disabled when a behavior is added to a field and the user won't be able to use the field on the view screen. One workaround provided is to manually set the field to be editable by placing code like this in the Initialiser Function of the behaviour:…
-
Hi Rahsmi, This sounds like the bug reported here: https://productsupport.adaptavist.com/browse/SRJIRA-2200 Because of the bug, the red asterisk appears next to the Attachments field instead of the custom field that it is supposed to be next to. This bug was fixed in SR 5.0.11.
-
There are two problems here. * Form values aren't available in initializers. You may need to use the underlyingIssue object. See open bug https://productsupport.adaptavist.com/browse/SRJIRA-2027 * Behaviours function on the Create Issue, Update/Edit Issue, Assign Issue, and Workflow Transition screens. They don't work on…
-
Hi, You could run a script like this in the Script Console: import com.atlassian.jira.component.ComponentAccessor def projectManager = ComponentAccessor.getProjectManager() def project = projectManager.getProjectObjByKey("CONFIG") // change project name here def versionManager = ComponentAccessor.getVersionManager() def…
-
In which way are you testing the behaviour? Unless you are linking an issue on the Create, Edit, or transition screen, the behaviour won't work because behaviours don't work on the View screen. If you are just looking at an issue and clicking the + button in the Linked Issues section to add an issue, the behaviour won't…
-
@Julius Davies _GitBoost_com_ hilarious
-
Hi Scott, Yes, iterating through the subtask issues with .each() would work fine here. It should be rather simple to do, like this: issue.getSubTaskObjects().each { subtask -> syncCustomFieldValue(issue, subtask, "yourNameOfField") }
-
Pablo, I am not able to reproduce the bug. I just added a behaviour to the "Linked Issues" field, added a server-side script that has a logging statement, and started changing the Linked Issues field on the create screen. As expected, I get this in the logs: 2017-12-04 15:14:58,950 http-bio-8080-exec-11 DEBUG admin…
-
I think your assumption is correct that you won't be able to create the comment if validator returns false and fails to pass.
-
@Antoine Berry Could you post this question through our support portal? We'll investigate it further and if necessary we will open a new development issue for Insight compatibility if it does not already exist. https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner/server/support
-
Hi Antoine, Apologies, I am not extremely familiar with 3rd party plugins. From configuring the insight plugin myself in my Jira instance, I also cannot set the value on the FormField. Behaviours don't seem to be fully compatible with Insight custom fields, which is also something we see with nFeed custom fields as well.…
-
This may not be possible yet. Is the Insight custom field of type "Label"? I believe behaviours are still incompatible with labels. https://community.atlassian.com/t5/Jira-Core-questions/Behaviours-insight-set-field-value/qaq-p/197420
-
Suresh, I would suggest using a Script Listener or Post-function to set the other custom field. You could set up a script listener that fires every time the issue is updated and it will set the checkbox to "Yes." Using a post-function, you could set the checkbox to "Yes" on a specific transition, like when the issue is…
-
Venkatesh, There is a big problem with your current script because you are still using ComponentManager. ComponentManager does not exist in JIRA 7, so any code with it will not work. See our documentation. import com.atlassian.jira.component.ComponentAccessor def commentManager = ComponentAccessor.getCommentManager()…
-
Hi Melissa, I am glad to hear you have it working, although that does sound like an inconvenience. If you would like to post your original question through our support portal, we would be happy to investigate further. I have not been able to reproduce what you have described. Josh
-
Hi @Suresh, It looks you are trying to set another custom field within your scripted field. Is that correct? You absolutely cannot set values using scripted fields. Our documentation on the website about script fields states this: You can use Groovy to display a "calculated" custom field on an issue. You cannot make any…
-
This could also be related to https://productsupport.adaptavist.com/browse/SRJIRA-1316 if they are on an older version of SR.
-
Hi Venkatesh, Which version of ScriptRunner and JIRA are you running? It seems like you are on an older version. Can you not use the built-in workflow validator feature provided by ScriptRunner? This will allow you to easily display an error message.
-
Glad I could help, Daniel! Thanks for using ScriptRunner!
-
Thanks for that information George. So in short, you were previously taking information from a custom field that allowed the user to specify a date manually. From that user-specified field, your scripted field was calculating a date. Now, you want to use the System Date instead of the user-specified field. Using the JIRA…
-
Yes. In addition to hiding the field on the "Edit" screen, this code will hide the comment field on non-workflow screens like "Assign Issue." If you click the "Assign" button, I think you'll see that the screen will no longer have a comment field. A better way to do it would be to check for the field screen name. Go to…
-
Well, I'm using JIRA out of the box with no modifications. If you've changed the Screen Schemes, I think it'd be possible for the code to no longer work. What if you just do this? getActionName() should always return null for the Edit screen, so it will make the comment field hidden. def commentField =…
-
Daniel, A behaviour script like this should hide the comment field on the "Edit" screen but not any other screen. def commentField = getFieldById(getFieldChanged()) if (getFieldScreen().name == "Default Screen" && !getActionName()) { // check if on edit screen commentField.setHidden(true) } Josh