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?
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?
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.
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.
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:
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.
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.
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.
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.
If you already heard about Smart Commits in Bitbucket, know that you just stumbled upon something even better (and smarter!): Genius Commits by Better DevOps Automation for Jira Data Center (+ Server...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events