I am using this script and the date from the parent is returning with blank Time. I want just the date to appear.
Using "Date" template on script and Date Time on the searcher I got the results I wanted of just the date only but... the date was one day off.
Currently I have it set to "Text field" template on script and free text on the searcher and its displaying date as "2021-01-04 00:00:00.0"
Thanks in advance for the help!
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import com.atlassian.jira.component.ComponentAccessor;
if (issue.isSubTask())
{
def field = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Received Date");
if (field != null)
{
return issue.getParentObject().getCustomFieldValue(field);
}
}
return null;
Hi @Duane Cronkite I guess value of the field is of java.util.Date type. So you just need to format it in "return" statement. So you have to add following lines to your source code:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.