Hi, all,
I need to have a custom field that will reflect the first time a specific transition occurred.
First I thought I would do it with a post-change action and copy value from Updated to my custom field (Closed Initial Report).
But this does not work in cases when the issue is reopened, and will eventually go through the same transition again, so the initial value will be overwritten, which we do not want.
I thought I may have more options in an automation rule, and I have managed to create a rule that will populate the custom filed with the current time when the transition occurs, but I would also like to add the condition to only populate if this field was previously empty.
However, when I select the Issue Fields Condition and try to select my custom field (so that the action would only be performed if the field is empty) I cannot find my custom field in the picker.
Anyone have any ideas, or an alternative solution?
thank you
Dora
Hi Dora,
The best thing would be to figure out why the field is not showing up in your list. If the field was recently added, try refreshing your Automation Rules list, and then go back in to do the edit.
Second is to make sure the field is on the Create/Edit screen and is available.
Third, check the context for the custom field to see if it matches with the Project you are working with.
Finally, what type of field is it? What type of project is it on?
Hi, John,
thank you for the suggestions.
I refreshed everything several times so I'm guessing that's not the issue.
The field is not on the create screen because only the system will populate it, at a later transition, and it is not on the edit screen because users must not edit it, so I added it only to the View screen.
Just to make sure, I tried adding it to all three screens, but still it is not in the picker.
The field has a global context, but I tried to make it specific to my project, and again no luck unfortunately.
The strange thing is that I just noticed that the solution with JQL "Closed Initial Report" is Empty works on our Server instance, but not in Cloud.
In both instances the field is not available in the picker.
BR
Dora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What type of Field? And what type of Project?
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.
And you can include the field in a filter and see the results?
And are you looking to update the field as a part of the Edit issue action?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you include a screenshot of your rule?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure. Here it is with the JQL, because the Issue fields condition would not find my custom field.
The validation of this jql works in the server instance, but in cloud no issues match the jql.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe try this in the More options section for JSON
{
"fields": {
"customfield_10003": "the value I want to set",
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't see the More options in any of the condition components, only in the Edit action component.
But if I add it to the action, wouldn't it have effect only on the value that will be set, and not on the condition in which it will or will not be set?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the Advanced Compare option. There you can add in "code".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried this option, but none of the issues match the condition again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure there are issues on that project that are in the Implementation status and the custom field is empty after you updated the rule? Remember that you are firing the rule on a transition. so to test you would need to fire it with a new transition to that status.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I definitely have some issue with this "is Empty" syntax, but not sure why.
There are issues in that status. On some the field is empty, and on some it is not, but the JQL says there are none where it is empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That makes no sense whatsoever. You need to submit a support ticket with Atlassian and show them that.
https://support.atlassian.com/contact/#/
Please post back here once you have a solution. Thanks!
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.
Sorry I couldn't have been more help, but something strange is going on there. :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
There is definitely a recent issue with "IS EMPTY" and text fields, and I wonder if this issue impacts other field types as well. The apparent cause is once a field has been set and then cleared, a distinction is made between BLANK and EMPTY in JQL and the API.
You may watch the progress of the fix for this issue here:
https://jira.atlassian.com/browse/JRACLOUD-74809
The work-around I have been using for this is to check field length of zero in addition to EMPTY. For a non-text field, you could try converting to text first and then checking length.
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, Bill, I'll check out the related issues.
In my case the field is a date field, and it is never cleared, but it could be something related, as there doesn't seem to be a logical reason why the system doesn't recognize the fields as empty.
BR
Dora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dora Lukin for a date field work-around, you could try this:
advanced compare condition for {{issue.myDateFieldName|0}} equals 0
What that will do is substitute a default of zero (0) when the field is blank or empty, and then test for zero.
__Bill
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.
Yes, I can filter by this field without problems, and I see it on the View screen.
I did some testing with other custom fields and it seems none of the date pickers are available in the automation rule field picker.
Is this a known issue perhaps?
And yes, I would update the field as part of the Edit issue action.
thank you
Dora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I experienced the same - date fields are not available in the selection.
I instead went with a JQL approach. If I understood your screenshot right the same like you did.
When needing to set such a field doing it via "More options" / JSON worked, like John said above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As far as JSON goes, I don't actually have any issues in the edit action, as the date field is available in the action component, but unfortunately not in the condition component.
So I can edit the field, but not with a condition.
The JQL "Closed Initial Report" is Empty works for me in the server instance, but not in cloud.
For some reason in cloud the validation for "Closed Initial Report" is Empty says there are no issues that match the search, even though when the same is entered in the filter search, there are issues that match it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also tried to add a condition to check if issue matches JQL:
"Closed Initial Report" is Empty
But even in cases when "Closed Initial Report" is not empty the automation will update the field with the new value.
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.