Hi,
date fields in JIRA, no matter if custom or system fields, are bein displayed in the "Dates" area. Until now I could live with that.
Now I had to create a generic workflow with x milestones. My customer wants the name of the milestone and the corresponding due date (as configured in my tab "milestones") displayed together. Has anyone an idea how I could accomplish that?
Thinking of workarounds I've been contemplating copying the date value into another custom field where the date is being represented as a string (seeting the string field to invisible via a behaviour).
Another idea might be (if thats possible) concatinating the milestone description field and the corresponding date field...
As you can see I'm pretty lost here.
Thanks for any help
Christian
The field appears there because the standard date field implements DateField interface. If you create a date custom field that doesn't implement the interface, it will appear as normal fields.
You can then put it under any tabs you want.
Another option is to tweak the bundled view issue plugin!
Hey Jobin,
this can't be done through the normal UI I guess... How can I modifiy the custom field in order to prevent implementing the DateField interface?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think that Jobin is suggesting that you create a new custom field type - it can be the same as the standard off-the-shelf Date custom field (if you have a license for Jira, you could download the source and see how that one works), but you tweak it slightly so that Jira thinks it's plain text (even though you could retain the date/time output, field handling and so-on)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Meant exactly what Nic said.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am trying to achieve same as Christina Czaia. I created custom date-field from custom field but it still shows under the date section. How can I tweak slightly?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You don't. If it's a date field, it's going to be moved.
If you want a date that doesn't move to the date panel, you will need to create a new field type that JIRA does not recognise as a date. That needs an add-on.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Im interested in this too so hope someone can help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Im interested in this too so hope someone can help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can always create new text field and during on of the transitions, copy the value of a date field and paste in to a text field. With this, you will be able to show it on any tab you want. It's kind of a workaround, but it did the job for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Witold Dziel
I have tried the same
my scripted field ends with
"def total = rt.sum() as Long
return (total / 1000) as long ?: 0L"
But when i copy the time to resolve scripted filed the output in text field is
the above field is text filed ,
it copies nos, rather than 14 hous,12 minutes.
any suggestion on that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your script is returning a number into a string field, so the field doesn't really know what you're trying to tell it.
My best guess is that your script should to changing the number returned explicitly to the string you want to see, but it is an odd conversion there, not what I would expect.
We don't know what tool you are using for the scripting, and I suspect there are other parts of the script we'd need to see before we can tell you what it is doing (against what it should)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, well, this does not look like what scriptrunner would do given just the lines of code you've given, so I'm a bit stuck. Could you give us the rest of the script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.history.ChangeItemBean
import com.atlassian.jira.issue.Issue;
import com.atlassian.core.util.DateUtils
def changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
def inProgressName = "In Progress"
List<Long> rt = [0L]
def changeItems = changeHistoryManager.getChangeItemsForField(issue, "status")
changeItems.reverse().each { ChangeItemBean item ->
def timeDiff = System.currentTimeMillis() - issue.getCreated().getTime()
if (item.fromString == inProgressName) {
rt << -timeDiff
}
if (item.toString == inProgressName) {
rt << timeDiff
}
}
def total = rt.sum() as Long
return (total / 1000) as long ?: 0L
//////////////////////////////////////////////////
How do i copy the output to a text field.
When i try to copy it gives me , the output in seconds.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, it's not giving you what you have in your screenshot ? It's giving you a properly formatted number?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, the "scripted field" is showing 1897 (seconds). The source field (which is not the scripted field) is showing 31 minutes (or 1897/60 rounded down)
That's not what you showed us before.
However, it is now showing correctly. Your script is returning a simple number which can be cast to a string automatically. The script says 1897, so that's what goes into the string.
If you want it to come out in a different format, your code will need to do some work to convert it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
my bad.
Let me rephrase my question,
Now i am trying to show the "Scripted field under the regular tabs of the tickets"
Any options to COPY or MOVE the scripted date field under the tab.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for the delay.
I don't recognise that behaviour, the field should be in the custom field section, unless the output was defined as a date/time field, which wouldn't come out with "31" or "31 minutes" in it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can this be of any help ?
http://confluence.kepler-rominfo.com/display/KCF/SIL+Script+Custom+Field
Its configuration would be something like:
return "Milestone: " + customfield_10011 + " Due: " + dueDate;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is an 8 year old link. Things have changed.
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.