Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Custom field removable for 691 Jira's

Hi All,

 

I need help with cleaning up JIRA, please: CLIENT has accidentally assigned a sprint to 691 JIRA tickets. Can we pls reverse that?

How to remove the  VALUE for Sprint Custom field for 691 Jira tickets ?

 

Kindly someone advise pls!!

1 answer

Hi! 

 

If you know exact scope, you can set null value via groovy on that tickets. 


String jqlSearch = ' JQL_QUERY_WITh_SCOPE'

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
IssueManager issueManager = ComponentAccessor.getIssueManager()
SearchService searchService = ComponentAccessor.getComponent(SearchService.class)
SearchService.ParseResult parseResult = searchService.parseQuery(user, jqlSearch)
CustomFieldManager customerFieldManager = ComponentAccessor.getCustomFieldManager()
CustomField myCustomField = customerFieldManager.getCustomFieldObjectByName("Sprint")
def issueIndexingService = ComponentAccessor.getComponent(IssueIndexingService.class)
if (parseResult.isValid()) {
def searchResult = searchService.search(user, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())
def issues = searchResult.issues.collect { issueManager.getIssueObject(it.id) }
for (issue in issues) {
myCustomField.updateValue(null, issue, new ModifiedValue(null, null), new DefaultIssueChangeHolder())
log.debug "Done for ${issue.key}"
boolean wasIndexing = ImportUtils.isIndexIssues()
ImportUtils.setIndexIssues(true);
log.warn("Reindex issue ${issue.key} ${issue.id}")
issueIndexingService.reIndex(issue)
ImportUtils.setIndexIssues(wasIndexing)
}
}

in general cleanup you can try that number of scripts https://github.com/gonchik/cleanup-scripts

Hi Gonchik,

 

How to remove the  VALUE for Sprint Custom field for 691 Jira tickets ?

 

Could you pls answer to that pls!

@Roja Gurram  Do you use the scriptrunner/mygroovy/Power Groovy for Jira/SIL groovy connector you can try to use the code I provided in previous comment. 

I just rewrote for your instance based on info of 7.3.1 version the code

searchResult.issues.collect

 

Otherwise, if you familiar SQL you can use the 2 table customfield and customfield value with join jiraissue, again if you know exact number of scope. 

1. You need to remove records

2. Restart Jira

3. Reindex Jira (or related projects)

Also, please, do on test env first, if you're not familiar with SQL, groovy. 

 

The last unuseful possible at least to me, it's bulk change. 

https://confluence.atlassian.com/jiracoreserver/editing-multiple-issues-at-the-same-time-939937916.html

As result you will have change history and will update tickets, to me is not good way. But for many companies it's useful solution

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.3.1
TAGS
Community showcase
Published in Confluence

⚡️NEW Group for Confluence Cloud Admins

Calling all Confluence Cloud Admins!  We created a new Community Group to support your unique needs as Confluence admins. This is a group where you can ask questions, access resou...

107 views 2 9
Read article

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