I have an internal customer that would like to require a comment if the due date for an issue is changed during a transition. I have been trying to use cPrimes Power Scripts to figure it out, but I feel like I'm chasing my tail.
I tried using lastIssueChanges but that seems to only report changes that have already been applied (after the transition is complete). My next thought was that I could use fieldHistory to check what the due date used to be (it will always be set by the time it gets to this point) and compare that with what it is during the transition. I can't get fieldHistory to report the history for the due date field though, so I'm kinda dead in the water. I've tried using due, dueDate, Due Date, nothing seems to work with fieldHistory(key,history_field_name_or_id)
Any one have any ideas for where I should go from here?
Try to use hasInput() function in a validator. You can find more info here:
Thanks for answering, but when I tried that it always succeeded because there is already a due date. I guess I could do something like ask for a 'New Due Date' but I'm hoping to avoid adding a new field for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to do it with the following validator script
JFieldChange[] changes = getFieldChanges(key, "duedate");
JFieldChange latestChange = changes[size(changes) - 1];
if (!isNull(latestChange) && dueDate != latestChange.newVal && !hasInput("comment")) {
string errMessage = "enter comment";
return false, errMessage ;
}
return true;
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.
@Alexey Matveev, I want to do the same option. If it possible, can you tell please, where I need to put this script?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Vladislav Danylenko You should install the Power Scripts add-on:
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.