Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Related to behaviour in Script runner Edited

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.crowd.embedded.api.Group
import com.atlassian.jira.issue.Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def zone = customFieldManager.getCustomFieldObject("customfield_10938")
def assigneGroup = customFieldManager.getCustomFieldObject("customfield_10919")
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def zoneValue = underlyingIssue.getCustomFieldValue(zone)
def groupValue = ComponentAccessor.getGroupManager().getGroup("Beta-Army")
def groupValue1 = ComponentAccessor.getGroupManager().getGroup("Speedsters")
Issue issue
List <Group> groupList = new ArrayList<Group> ()
def issueChangeHolder = new DefaultIssueChangeHolder()
if (zoneValue.toString() == "Ahemdabad"){

issue.setCustomFieldValue(assigneGroup,[groupValue])
}else if (zoneValue.toString() == "Chennai"){
issue.setCustomFieldValue(assigneGroup,[groupValue1])
}

Throws an error which says "Issue is undeclared". 
Please provide me with a solution. I am trying to write a behaviour on a custom field.

Thanks,
Priyanka

1 answer

Hi @Priyanka Karguppikar 

As stated in the error description, there is not a variable called issue in Behaviours.

You should use underlyingIssue instead of issue.

See this page please.

Tuncay

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you