Hi,
I want to create a scripted date field (FIELD 1) that copies the value of another date field (Due Date).
But, after issue creation, the field FIELD 1 must be LOCKED.
Can someone please help me with how to achieve this . thank you
Only put the new field on the View screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the new scripted field write this code.
issue.dueDate
May be 2 more configurations if you are dealing with date field.
Searcher: Date Time Range picker
Template: Date Time
You may need to add more code to handle errors. It is bare minimum.
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ravi Sagar _Sparxsys_ Thank you for the comment.
I have not written scripts.
does the above line copy the field value to the new field. But how do I ensure that that the value entered first is fixed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are some plugins, I use jira suite utilities (JSU) to copy fields during a transition. JIRA has the ability to copy some fields. I don't know if due date is one of them. The plugins expand the list of fields. You must copy to another date field. JIRA has no way of 'locking' a field. that is why I said to only put the new field on the view screen. The only way to update it would be with a script or post function. A user can't edit it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Aisha M
Yes that is the job of the scripted field, it will have the due date. What do you mean by "..value entered first is fixed"?
I should have asked, why are you doing this? What is your objective?
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With @Ravi Sagar _Sparxsys_ 's answer, he mentions a "scripted field" - these are created by Adaptavist's ScriptRunner, and don't contain editable data - they calculate something (even if it's just a copy of the data of another field) and expose it as a field, but it can't be edited, even if you put it on the edit screen.
There are other apps that can do something similar. I'm less familiar with them because I work for Adaptavist too, and hence just use SR 99% of the time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ravi Sagar _Sparxsys_
Hi . I mean to say the new field must copy the first DUE DATE value entered. Later, if the DUE DATE is changed, the new field must NOT take the new value. Basically, the first value copied must be fixed.
We want to do this for some certain tracking purposes.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now it is clear. In that case use a post function to update the "Original Due Date" custom field not a scripted field. What you are doing is baselining. Also take a look at some apps like BigPicture or Portfolio, these have such features built in but for the time being post function should do the job.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ravi Sagar _Sparxsys_ But how do I make sure that the new field value when someone changes the Due Date ? What conditional statement should I use for this. Can you please help.
Thank you !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The post-function runs at a certain point in the workflow. If you do not go through that transition again, the value in the field will not change.
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.