Hi,
I am trying to create a custom listener in where the field "Create Date & Time" is updated when an issue is commented on. The field should update to the date the issue was created on.
The reason for the listener is older issues were this fields needs to be updated.
The script is as follows but it does not seem to work:
Log Error:
2022-03-09 12:35:32,088 ERROR [runner.AbstractScriptListener]: ************************************************************************************* 2022-03-09 12:35:32,088 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file: null groovy.lang.MissingPropertyException: No such property: Created Date & Time for class: com.atlassian.jira.issue.fields.ImmutableCustomField at Script2015.run(Script2015.groovy:10)
There's two things to look at here.
First, the technical one - the second to last line is trying to set a variable to the date/time an issue was created, but it does nothing with that variable, and that variable can't accept the value you're trying to set because the variable is already set to be a custom field, not a date/time value.
What you probably want to do is set the value of the custom field to the date/time you are working with.
Second, the reporting question - why are you setting a custom field to a value that already exists on the issue, and why is that useful every time someone makes a comment on the issue? You already have the issue.created date/time stamped on it, and if you are actually looking for the last update (such as comment), then issue.updated is what you're looking for.
So the system field "created" is not visible when you try to add it to a screen in a project on JIRA and if the field is not visible on the screen then you cannot see that field on the Aha Integration side.
Which is what is needed - to see the "created" date.
The work around was a new custom field called "Created Date & Time" which is a date/time field that shows this information (you can add this to a screen and thus be visible on the Aha Integration).
Going forward, this custom field is updated with a post function on the workflow when an issue is created - that works fine.
However, the issue is with older tickets that need to be updated with this info (created date & time) - it is far too many tickets to attempt manually so that's why if possible with a listener.
But I seem not to be getting it right - essentially copying the "created" value to "created date & time" on an issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Eh? That's not true, the created date is on the issue view screen automatically. I've got no problem seeing it in Aha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure then what is with our instance but we cannot seem to find it. Thanks though. Will have a look further.
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.