Hi!
We are currently trying to upgrade from JIRA 6.2.x to JIRA 7.3. Currently we have especially with Script Runner some issues.
We have a function that on a specific transition a sub task will be created and a person that is filled out in a custom field should be the assignee of the new sub task.
For that we've put the following text into the "Additional issue actions" field:
import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.ComponentManager cfParent = com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName('Team Lead') parentMyFieldValue = transientVars["issue"].getCustomFieldValue(cfParent) issue.setAssignee(ApplicationUsers.toDirectoryUser(parentMyFieldValue))
In 6.2 it works flawless, in JIRA 7.3 we are getting several errors:
For Line 3: The variable cfParent is undeclared
For line 4: The variable parentMyFieldValue is undeclared / Cannot find matching method
For line 5: the variable parentMyFieldValue is undeclared / And 2x Cannot find matching method
Hopefully someone can help me
Thanks in advance
We're not yet compatible with JIRA 7.3. You can see the versions we are compatible with here.
Atlassian made some changes in JIRA 7 requiring you to change your scripts slightly.
Please try the following code for JIRA 7:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.user.ApplicationUser def issue = issue as MutableIssue def customFieldManager = ComponentAccessor.getCustomFieldManager() def cfParent = customFieldManager.getCustomFieldObjectByName('Team Lead') ApplicationUser parentMyFieldValue = issue.getCustomFieldValue(cfParent) issue.setAssignee(parentMyFieldValue)
Line 3,4 - you need def in front of the variable name otherwise the type checker will complain. Line 5 - setAssignee takes an com.atlassian.jira.user.ApplicationUser instead of a com.atlassian.crowd.embedded.api.User.
Please see here for more information about how to change your scripts for JIRA 7.
Thank you for your help. Pasting your code brings on additional error in line 9.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adam, when will the next version that supports 7.3 be available?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its going to be in the next few days, we are actively working on it as the top priority. We have had some issues with the rich text editor and the behaviours functionality. Apologies for the delay.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Samir, try this:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.issue.fields.CustomField import com.atlassian.jira.user.ApplicationUser def issue = issue as MutableIssue def customFieldManager = ComponentAccessor.getCustomFieldManager() CustomField cfParent = customFieldManager.getCustomFieldObjectByName('Team Lead') ApplicationUser parentMyFieldValue = issue.getCustomFieldValue(cfParent) issue.setAssignee(parentMyFieldValue)
Its because cfParent was not strongly typed. Although you see an error in the static type checker in these situations the script should still work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.