Comments
-
Hi Ewa, Not sure if you have already figured out the answer to this question, but yes you can definitely use the field value as a condition. The condition could be something as simple as this for a regular text custom field: cfValues['Some Custom Field'] == 'Some Value' Or, you could have a condition that checks for…
-
Hi Rhian, Do you need each of these sub-tasks to have different information? Or will all of the sub-tasks contain all of the same information? Creating sub-tasks automatically on a workflow function is already a feature built-in to ScriptRunner. * Go to the workflow step you want to create sub-tasks on * Click add Post…
-
Hi Daniel, Apologies for not getting that information from you sooner. Just to clarify, you are testing this script on an instance of JIRA 6.3.15 with SR 3.1.4? If so, I am not sure that the script I gave you will work at all. I wrote and tested that script with JIRA 7.4.1 and SR 5.0.15. I unfortunately don't think I have…
-
Hi Dan, You're correct that you need to replace your group name instead of 'jira-administrators'. Make sure you replace that in both places in the script, I believe lines 8 and 11. I would ensure that you have the right group name. In JIRA, if you go to User Management -> Groups, it will give you the exact group name. You…
-
Hi Praveen, I would probably not use a behaviour for this. The reason being is that every time you do anything to the issue (Create, Transition, Edit, etc) the behaviour will run the JQL function repeatedly. You could try putting the code in an initializer function behaviour, but there is currently an open bug about not…
-
Hey Daniel, The script would look something like this: import com.atlassian.crowd.embedded.api.Group import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.ModifiedValue import com.atlassian.jira.issue.util.DefaultIssueChangeHolder import com.atlassian.jira.issue.util.IssueChangeHolder def…
-
Hi Vinoth, I'm happy everything is working now! Feel free to select my answer as the accepted answer for this question so that others will see it if they have the same issue. Thanks for using ScriptRunner! :) Regards, Josh
-
Hi Vinoth, Glad to hear that it works! That error message you're getting seems to be coming from com.innovalog, so this doesn't look like a ScriptRunner problem. It looks like you're using the JIRA Misc Custom Fields plugin. From what the error is saying, you need to go to the Transition Info custom field and fix the…
-
Hey Vinoth, I see two problems. First, are you using the escape character '\' whenever you use quotes? When writing a JQL query inside of a script, you'll need to do that. For instance, your query would like like this: def query = jqlQueryParser.parseQuery("project= xyz and issuetype= story and \"Story Name\" is EMPTY) The…
-
Hey slothstronaut, I am not sure if you ever figured this out, but I just ran into this exact issue. I was having trouble getting my scripted fields to search by their numeric value. All you need to do is: * Go to the Custom Fields page * Find the scripted field * Click edit * Change the Search Template to Number Searcher…
-
Hi Vinoth, You can run the following script in the script console to update all of the custom fields for specific issues. Just replace the JQL query with one that will match the issues you're trying to replace, e.g. "type = story". import com.atlassian.jira.component.ComponentAccessor import…
-
Hi Vinoth, You can run the following script in the Script Console to search for specific issues and replace all custom field values. Just change the JQL query to match whatever issues you're trying to find, e.g. "type=story". import com.atlassian.jira.component.ComponentAccessor import…
-
You could also use this in your script to copy comments from the original issue to the cloned issue: def commentManager = ComponentAccessor.commentManager doAfterCreate = { commentManager.getComments(sourceIssue)?.each { comment -> commentManager.create(issue, comment.authorApplicationUser, comment.body,…
-
Hi Stanislava, What ScriptRunner version are you running? Writing a script to copy comments to a cloned issue does not seem like something you need to do, because this is already a feature in ScriptRunner. You can add a Script Post-Function for "Clone an Issue and Links." On that page, you can simply check the "Copy…
-
I can reproduce the error you're having if I use your original code using the primitive float, which makes sense because if the custom field is empty (null), you won't be able to cast it. It works for me using the object Float. You should definitely use the number custom field. Your script will work with a regular text…
-
Hi hreich, It looks like you have a relatively simple error here. You wrote issue.summary = newSummary. However, this will not allow you to actually set the summary. You just need to use the setSummary method, e.g. issue.setSummary(newSummary). import com.atlassian.jira.component.ComponentAccessor;import…
-
The object Float can be set to null to represent a value that is unknown. The primitive float is guaranteed to have a value. I think that's why the error is telling you to use java.lang.Float. Perhaps try writing: Float accrual = issuesInfo.get(s).getCustomFieldValue(cfaccrual) as Float?:0
-
Hi Todd, You can accomplish this by using post-functions in ScriptRunner. For your first problem of transitioning an issue's subtasks to "Done" whenever the issue is transitioned to done, you'll need to add a script post-function on the transition step to Done. The following script will transition all of the subtasks.…