Hi,
I have two custom date fields i.e., Target start date and Target end date. Target end date should be future should to Target start date on all screens.
How to achieve this?
Pluggings: SIL and ScriptRunner available
Hi @Arunajyothi Samala , Hope you are doing well. I assume that you are looking to ensure that on Create or Issue Edit, Target End > Target Start Date.
With ScriptRunner for Jira Data Center, you can do this with Behaviours. Here is a sample script which works, but you will need to make changes to match your Jira Instance's Custom Field : ScriptRunner Jira DC - Behaviours (Date Picker Field B > Date Picker Field A)
It is relatively straight forward but if there are any issues, do feel free to open a support ticket with us from ScriptRunner.
Regards,
Sean
Hi @Sean Chua _Adaptavist_ ,
I tried your solution as intialiser script from but it doesn't prevent the user for creating an issue with end date before start date. audit logs show it got excuted but didn't restrict the creation of the issue.
I observed that the first two variables defined with object command were never used, could you please let me know if I did anything wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Arunajyothi Samala ,
Thanks for getting back to me. Based off the script alone, I am unsure why it doesn't work for you. There could be other reasons, so while straightforward, wouldn't hurt for you to open a support ticket with us to investigate with our support engineers.
Just to show you that mine doesn't allow me to create a ticket or save the edit issue changes when the Target End is before Target Start. I'm using ScriptRunner for Jira DC v8.18.
The Custom field type are "Date Picker";
Regards,
Sean
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes @Sean Chua _Adaptavist_ Both are data pickers. Sorry little busy with deployments, couldn't get back to you on time. I tried the other way around, instead of intialiser , I tried two fields with server side scripts using fieldIdchanged function. that scripts are working fine. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Arunajyothi Samala ,
With SIL, you can add a validator script as below to check if the target end date is always greater than the target start date on a transition screen.
if(getInput("customfield_10801") < getInput("customfield_10800"))
{
return false;
}
Hope this helps!
BTW, I am Reshma from Appfire, a vendor of SIL Engine and Power suite apps.
Thanks,
Reshma
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.