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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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