Hi,
I have the following code that is creating a related issue via a behaviour,
Behavious methods run against/witch the form data.
While the native jira methods run against/with database data.
So when you retrieve the value of the customfield using contextIssue.getCustomFieldValue() you get a "Timestamp" object (that a jira api call from the com.atlassian.jira.issue.Issue class)
But the "setFormValue" needs a valid string since that's what the form expects.
Something like this should work:
def sourceDate = underlyingIssue.getCustomFieldValue(33008) //this uses a HAPI extension method that bypasses the need for the customFieldManager
getFieldById('customfield_33008').setFormValue(sourceDate.format('d/MMM/yyyy')).setReadOnly(true)
Hi @PD Sheehan
I tried your suggestion but it didn't work. What I finally got working was a variation of yours,
def sourceDate = contextIssue.getCustomFieldValue("Baseline M2 Date")
Appreciate your help :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Peter Ellis
I would suggest to use jira automation. That would be easier to do so.
And wrt your code. Please check the date format in parent and child ticket (if they are different) and Convert the date to correct format.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline 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.