Hi,
ScriptRunner has ability to import custom field values in bulk (https://scriptrunner.adaptavist.com/4.3.6/jira/builtin-scripts.html#_bulk_import_custom_field_values) but I need to remove/delete all of the custom field values - any way to do this with ScriptRunner (maybe running script from Script Console)?
Thanks for help in advance!
Any way of doing this that doesn't involve deleting field values one by one?
Have you found any solution for removing field values one by one?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I'm sorry if i don't understand the question but what about a groovy scriptrunner script to do a jql query to obtain all issues with values at the particular field and then do and then set the value to null on this fields?
i think i have an snippet to do that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, of couse, but you need to create a custom service i think.
You need to download the sdk, create an skeleton of jira plugin, add your login and then install the plugin in your instance.
It's more work, the code should look very similar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
okay, i will try jql query to search the issues and the label with the values. Thanks for the help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here you can find great examples:
https://jamieechlin.atlassian.net/wiki/spaces/GRV/pages/1212431/Miscellaneous+Groovy+Scripts
"Executing a Query"
package examples.docs
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser.class)
def searchProvider = ComponentAccessor.getComponent(SearchProvider.class)
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getUser()
// edit this query to suit
def query = jqlQueryParser.parseQuery("project = JRA and assignee = currentUser()")
def results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())
results.getIssues().each {documentIssue ->
log.debug(documentIssue.key)
// if you need a mutable issue you can do:
def issue = issueManager.getIssueObject(documentIssue.id)
// do something to the issue...
log.debug(issue)
}
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.