I have two custom fields: "A" and "B". I would like to know if there's a way to automate field "A" so when field "B" is set to "Yes", field "A" is automatically filled with the "date and time" when the field "B" was set to "Yes".
Right now I'm able to do that but I'm using "Behaviors" and, every time I edit the issue, it updates the field with the current date and time again.
Hi Fabio,
I am one of the founders of Code Barrel and we make Automation for JIRA.
It should be fairly easy to achieve this with Automation for JIRA. You could setup an Automation rule like this:
The field value changed trigger will only run the rule when the particular field A is edited. The condition will make sure the issue is only edited when the field was set to 'Yes'.
Cheers,
Andreas
Thsi is the script I'm using now:
import com.onresolve.jira.groovy.user.FormField FormField automated = getFieldById(fieldChanged) FormField automatedDate = getFieldByName("Automated Date") String automatedValue = automated.getValue() String automatedDateValue = automatedDate.getValue() Date now = new Date() String nowString = now.format('dd/MMM/yy hh:mm a') if (automatedValue == "Yes") { automatedDate.setFormValue(nowString) } else { automatedDate.setFormValue("") }
I tried to modify the "if" to something like that:
if (automatedValue == "Yes" && automatedDateValue == "")
but then the "Automated" field is blank all the time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the script I'm using:
import com.onresolve.jira.groovy.user.FormField FormField automated = getFieldById(fieldChanged) FormField automatedDate = getFieldByName("Automated Date") String automatedValue = automated.getValue() String automatedDateValue = automatedDate.getValue() Date now = new Date() String nowString = now.format('dd/MMM/yy hh:mm a') if (automatedValue == "Yes") { automatedDate.setFormValue(nowString) } else { automatedDate.setFormValue("") }
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.