Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to group same type fields together on the issue page ?

Aisha M
Contributor
June 27, 2018

I want all the date fields to be displayed under the DATES section of the issue page. There seem to be all over the place at random places.

 

Any help please. Thank you

1 answer

1 vote
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2018

Hello,

Could you provide a screenshot? Usually all dates go into the dates web panel in the issue detail view.

Aisha M
Contributor
June 27, 2018

@Alexey Matveev I can't screenshot due to security reasons :(  I have a scripted field for displaying the Fix Version release Date. It shows up under the DATES section sometimes, and at the others places. Looks so random. Is there a way to group the fields on how they appear ? 

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2018

You can use tabs in the screens to grouping fields. You can find more info about tabs here:

https://confluence.atlassian.com/adminjiraserver/defining-a-screen-938847288.html

Go to the Configuring a screen's tabs and fields part.

But still dates must go to the dates part. Are you sure that you provided the correct template for your scripted field?

Aisha M
Contributor
June 27, 2018

@Alexey Matveev Yes, I selected the Absolute Date picker for the scripted field. 

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2018

It is a strange behaviour. As far as I understand this scripted field is from the ScriptRunner plugin. If so I would open a ticket in Adaptivist.

Aisha M
Contributor
July 9, 2018

@Alexey Matveev Hey, I had used a custom template for the scripted field, since I had to remove the time stamp from it. So, hence its showing up at random places. Is there a possibility to make the field show up under the DATES on the issue page, inspiote of using a custom template ? Your thoughts on this please

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2018

The template has to be the date/time one for Jira to recognise it as a date and move it to the date/time panel.

Aisha M
Contributor
July 9, 2018

@Nic Brough -Adaptavist- At the CUSTOM FIELD configuration page, the search template for the field is defined as DATE TIME RANGE PICKER.

Also, the field is a scripted field which is supposed to display the Release date associated with a Fix Version. Initially the script returned a DATE & TIME value which caused some issues due to time zone differences. Hence, I added the below custom template to the scripted field to remove the TIME STAMP,

$datePickerFormatter.withStyle($dateTimeStyle.DATE).format($value)

Now, the field is not showing up under the dates section. Any help on how to fix this, please

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2018

@Aisha M Hopefully someone from Adaptavist can answer your question. I do not have access to source code, that is why I am not sure how it works internally.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2018

Is the template for the output also a date-time template?  You can't use a string or number etc.

Aisha M
Contributor
July 9, 2018

@Nic Brough -Adaptavist- I have included the script for your reference.

Custom Template -

$datePickerFormatter.withStyle($dateTimeStyle.DATE).format($value)

Inline Script - 

import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.bc.issue.IssueService
import java.lang.Exception
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.project.version.Version
import java.text.SimpleDateFormat
import java.sql.Timestamp
import java.text.DateFormat
import java.util.Date
Collection versions = issue.getFixVersions()
if (versions==null || versions.size()!=1)
return null
def version = versions.iterator().next()
new Date(version.releaseDate.time)

  The output returns only the DATE value without the time stamp.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2018

You need to use the date/time template, not a custom one.

Aisha M
Contributor
July 9, 2018

@Nic Brough -Adaptavist- If I do that, I get the date and time as the output. I want only the date. Can that not be done ?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2018

Jira won't see it as a date/time unless you use the date output type.

Aisha M
Contributor
July 9, 2018

@Nic Brough -Adaptavist- Okay. So, is there any possibility of getting only a date value by using the date and time template ? Because, it is crucial to not have a time stamp in my case

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 9, 2018

I don't think it is.  You need a template that announces the field as a date/time in order to get the field in the date/time panel, but they'll always have a time element, as the template is used for date and time.

You can remove it by using other templates, but then the field can't be grouped becuase it's not the right type.

Aisha M
Contributor
July 10, 2018

@Nic Brough -Adaptavist- There is another template available called "Absolute Date Picker". Can that be modified to return only the date value without the time ?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 10, 2018

Not without hacking ScriptRunner.

Aisha M
Contributor
July 10, 2018

@Nic Brough -Adaptavist- hmm, I guess I ll have to either have my fields grouped together, or remove the time stamp. Anyway, thank you ! 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 10, 2018

Sorry I couldn't really solve it, I think we're stuck with the templates only saying "hey, I'm a date" for full date/time sets.

Aisha M
Contributor
July 10, 2018

@Nic Brough -Adaptavist- Anyway, thank you so much Nic for keeping up with all my questions :) Really appreciate your inputs 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events