Hi Team
I have a custom field with Date and Time picker but now realized fields should be only "Date" and do not need time also to be captured.
Thanks in advance.
Hello,
It is impossible to change a custom field type through the UI interface. The safest way is to create a new field and copy all values from the old field to the new field using an add-on like Power Scripts or ScriptRunner.
Hi Alexey,
we are using script runner plugin, I am not expertized in a script, please guide me how to use a script in this case.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your script would look like this. You can run it in the ScriptConsole of the ScriptRunner plugin. Kindly check the script first in a test environment.
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.fields.config.FieldConfig
import com.atlassian.jira.issue.context.IssueContextImpl
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.issue.customfields.option.Options
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
def findIssues(String jqlQuery) {
def issueManager = ComponentAccessor.issueManager
def user = ComponentAccessor.jiraAuthenticationContext.user
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser.class)
def searchProvider = ComponentAccessor.getComponent(SearchProvider.class)
def query = jqlQueryParser.parseQuery(jqlQuery)def results = searchProvider.search(query, user, PagerFilter.unlimitedFilter)
results.issues.collect { issue -> issueManager.getIssueObject(issue.id) }
}
def user = ComponentAccessor.jiraAuthenticationContext.user
CustomField cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("source field name")
CustomField cf1 = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("destination field name")
def jqlQuery = "Your JQL query to choose all required issues here"
def issues = findIssues(jqlQuery)issues.each{it -> log.error it.getCustomFieldValue(cf);
cf1.updateValue(null, it, it.getCustomFieldValue(cf), new DefaultIssueChangeHolder());
}
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.
You are welcome! Try this solution in a test environment first. If it works, kindly accept my answer. In this case other people with similair question will be able to find this answer.
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.
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.