Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Copied custom field doesn't show up in search issue navigation when filtered by it.


I have a custom field(not script field) 'Team'. I created another custom field 'teamCopy' and used the below script to copy values of 'Team' to 'copyTeam'. It worked. When I go to issue navigation, 'copyTeam' custom field shows the values are copied successfully but when I filter the search with a 'copyTeam' value it doesn't show any result. What am I missing?

the goal is to go to issue nagivation and filter by 'teamCopy' value e.g. CRC.360 and get the result which I'm not getting but without filter the teamCopy Column shows the copied values.

Here is the code. I ran the script in script runner script console.

import com.atlassian.jira.CompomemtManager;
import com.atlassian.jira.issue.CustomManager;
import com.atlassian.jira.fields.CustomId;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.ModifiedValue;
import com.atlassian.jira.issue.utilDefaultIssueChangeHolder;
import com.atlassian.jira.MutableIssue
import com.atlassian.jira.jql.parser.JqlQueryParser;
import com.atlassian.jira.web.bean.PagerFilter;
import com.atlassian.jira.event.type.EventDispatchOption
import java.sql.Timestamp;

def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser.class)
def searchProvider = ComponentAccessor.getComponent(SearchProvider.class)
def issueManager = ComponentAccessor.getIssueManager()
der user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def query = jqlQueryParser.parseQuery('Team is not empty')
def results =, user, PagerFilter.getUnlimitedFilter())

results.getIssue().each{documentation ->;
MutableIssue issue = issueManager.getIssueObject(
//this is team object
def field_pp = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName('Team')
def ppText = issue.getCustomFieldValue(field_pp).toString();
log.debug("teamval :${ppText}");
//this is teamCopy object
def field_se = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName('teamCopy')
def seText = issue.getCustomFieldValue(field_se);

field_se.updateValue(null, issue, new ModifiedValue(seText, ppText), new DefaultIssueChangeHolder());
log.debug("teamval :${seText}");

issueManager.updateIssue(user, issue, EventDispatchOption.ISSUE_UPDATED,false);
issue.setUpdated(new Timestamp(System.currentTimeMillis()));




Log in or Sign up to comment

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