Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Update Asset Attribute via Automation - Date Field

Nicole Brückner April 25, 2024

Dear Community, 

I try to update an Asset Object via Automation (provided by Scriptrunner). 

In

  • customfield_19103 is the asset object referenced and in 
  • customfield_16512 is the date, which will be maintained in the ticket. 

I don't know the right format for date array in json. Can you please help?

{
"objectKey": {{issue.customfield_19103.key.asJsonString}},
"Submission Date": {{issue.customfield_16512.date.asJsonArray}}
}

Best regards-, 

Nicole2024-04-25 17_07_01-Automation - Nexus AG - Jira und 15 weitere Seiten - Geschäftlich – Microsoft​ E.png

1 answer

1 accepted

1 vote
Answer accepted
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 2, 2024

Hi @Nicole Brückner

From the configuration you have shared, I suspect this will not work.

Currently, you are passing the value into the Submission Date attribute as an array, i.e.:-

"Submission Date": {{issue.customfield_16512.date.asJsonArray}}

Could you please try to modify your configuration to a String, i.e.:-

{
"objectKey": {{issue.customfield_19103.key.asJsonString}},
"Submission Date": {{issue.customfield_16512.date.asJsonString}}
}

And see if it works.

I am looking forward to your feedback.

Thank you and Kind regards,

Ram

 

 

Nicole Brückner May 2, 2024

Hi @Ram Kumar Aravindakshan _Adaptavist_ 

Thanks for the effort. With string the same error message appears: 

Unexpected error executing rule:
Could not parse input as JSON. Input after smart values applied was: '{ "objectKey": "NXSPCRM-236126", "Submission Date": }'
Is there any issue in regards of the Timing unit? 
In Asset we have dd.mm.yy and in Jira we have dd.mm.yyyy
Could this be point? 
Best-,
Nicole
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2024

Hi @Nicole Brückner

From the error message returned it seems that an empty value is entered in the Submission Date.

Could not parse input as JSON. Input after smart values applied was: '{ "objectKey": "NXSPCRM-236126", "Submission Date": }'

Please confirm if the value is entered for the submission date.

It would be helpful if you could share a screenshot of the date field you are trying to pass and also the structure of your Asset object.

You also asked:-

Is there any issue in regards of the Timing unit? 
In Asset we have dd.mm.yy and in Jira we have dd.mm.yyyy
Could this be point? 

This could also be possible. It would be good to set the format in the Asset date to match your Jira date format and retest it.

Thank you and Kind regards,
Ram

 

 

 

Nicole Brückner May 13, 2024

Dear @Ram Kumar Aravindakshan _Adaptavist_

I fixed this

  • Add "fields" into the Submission Date Line
  • with putting the Date into ""

{
"objectKey": {{issue.customfield_19103.key.asJsonString}},
"Submission Date": "{{issue.fields.customfield_16512}}"
}

 

Thanks for the help. 

Nicole

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events