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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,457,311
Community Members
 
Community Events
176
Community Groups

Unable to insert date variable into date field

I am attempting to automatically get the Start Date from the description for new staff, this does successfully retrieve the date and works when I'm commenting the variable, however the variable doesn't work with the Start Date field.

 

I have attempted to paste the commented date into the Start Date field and that works fine.

Untitled.png

2 answers

1 accepted

0 votes
Answer accepted
Carlos Faddul Community Leader Dec 13, 2022

Hi @Timothy Harris , can you share a example of description that you are using ?

Maybe the format the in the Jira are wrong or maybe the description have some wrong format to match.

You can see the description at the bottom-right of my screenshot, it is

"Start Date: 15/12/2022

TEST"

Carlos Faddul Community Leader Dec 14, 2022

Hello @Timothy Harris 

I recorded a video/tutorial to help you to solve this.

I apologize for my bad english to speak

https://youtu.be/aRxAXZ7m0TU

But if you don't want to see the video, you just need one action that is to convert your variable (text) to Date then set in the correctly desirable field

I hope I helped you.

If this post was helpful, mark it as "Accept Answer" , so you can help others who may have the same difficulties.

If your question has not been resolved, please post again with more details.

Hi @Carlos Faddul ,


That video was brilliant, thank you for your help, however it didn't fix the issue. I've pasted my audit log alongside my Automation configuration.

Untitled.png

Carlos Faddul Community Leader Dec 15, 2022

@Timothy Harris

I run the automation like your automation and the automation runs without problems, follow the json file

{
"cloud": true,
"rules": [
{
"id": 9567540,
"clientKey": "1970ac34-1f27-35b3-b5e4-1b83c6409f94",
"name": "Community Date Convert",
"state": "ENABLED",
"description": "https://community.atlassian.com/t5/Jira-Software-questions/Unable-to-insert-date-variable-into-date-field/qaq-p/2216037?utm_source=atlcomm&utm_medium=email&utm_campaign=immediate_general_answer&utm_content=topic&lightbox-message-images-2216037=230357iFEF26DF132AA3000",
"authorAccountId": "5a871346cad06b3537342818",
"actor": {
"type": "ACCOUNT_ID",
"value": "557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"
},
"created": 1671065392688,
"updated": 1671114221023,
"trigger": {
"id": "195670657",
"component": "TRIGGER",
"parentId": null,
"conditionParentId": null,
"schemaVersion": 1,
"type": "jira.jql.scheduled",
"value": {
"schedule": {
"cronExpression": "",
"method": "BASIC",
"rate": 0,
"rateInterval": 86400,
"rRule": "BEGIN:VEVENT\nDTSTART;TZID=America/Sao_Paulo:20221214T204553\nRRULE:FREQ=WEEKLY;BYHOUR=9;BYMINUTE=0;BYSECOND=0;BYDAY=WE;INTERVAL=1\nEND:VEVENT\n"
},
"jql": "key = EK-1129",
"executionMode": "jql",
"onlyUpdatedIssues": false
},
"children": [],
"conditions": [],
"connectionId": null
},
"components": [
{
"id": "195670658",
"component": "ACTION",
"parentId": null,
"conditionParentId": null,
"schemaVersion": 1,
"type": "jira.create.variable",
"value": {
"id": "_customsmartvalue_id_1671064636412",
"name": {
"type": "FREE",
"value": "StartDate"
},
"type": "SMART",
"query": {
"type": "SMART",
"value": "{{issue.description.match(\"Start Date:\\s(.*)\")}}"
},
"lazy": false
},
"children": [],
"conditions": [],
"connectionId": null
},
{
"id": "195670659",
"component": "ACTION",
"parentId": null,
"conditionParentId": null,
"schemaVersion": 1,
"type": "codebarrel.action.log",
"value": "StartDate - {{StartDate}}",
"children": [],
"conditions": [],
"connectionId": null
},
{
"id": "195670660",
"component": "ACTION",
"parentId": null,
"conditionParentId": null,
"schemaVersion": 1,
"type": "jira.create.variable",
"value": {
"id": "_customsmartvalue_id_1671065001299",
"name": {
"type": "FREE",
"value": "StartDateFormat"
},
"type": "SMART",
"query": {
"type": "SMART",
"value": "{{StartDate.toDate(\"dd/MM/yyyy\")}}"
},
"lazy": false
},
"children": [],
"conditions": [],
"connectionId": null
},
{
"id": "195670661",
"component": "ACTION",
"parentId": null,
"conditionParentId": null,
"schemaVersion": 10,
"type": "jira.issue.edit",
"value": {
"operations": [
{
"field": {
"type": "ID",
"value": "duedate"
},
"fieldType": "duedate",
"type": "SET",
"value": "{{StartDateFormat}}"
}
],
"advancedFields": null,
"sendNotifications": true
},
"children": [],
"conditions": [],
"connectionId": null
},
{
"id": "195670662",
"component": "ACTION",
"parentId": null,
"conditionParentId": null,
"schemaVersion": 1,
"type": "jira.issue.comment",
"value": {
"comment": "{{StartDateFormat}}",
"publicComment": false,
"commentVisibility": null,
"sendNotifications": true,
"addCommentOnce": false
},
"children": [],
"conditions": [],
"connectionId": null
}
],
"canOtherRuleTrigger": false,
"notifyOnError": "FIRSTERROR",
"projects": [
{
"projectId": "10029",
"projectTypeKey": "software"
}
],
"labels": [],
"tags": [
{
"id": 19798714,
"tagType": "IS_RULE_UPDATED",
"tagValue": "true"
}
],
"ruleScope": {
"resources": [
"ari:cloud:jira:a94c6a97-c44c-49bd-a6f6-d6dbab8ce06b:project/10029"
]
},
"writeAccessType": "UNRESTRICTED",
"collaborators": []
}
]
}
Like # people like this

@Timothy Harris when you create the StartDateFormat variable you have a period between the words Start and Date, creating a null value rather than the value you expected...and...to then use a mask you must use the format() function.

Untitled.png

Like Timothy Harris likes this

It works, thank you both for helping me with this issue!!

Like Bill Sheboy likes this
0 votes

Hi @Timothy Harris 

Created variables are text type, and you can set them in a date or date/time field by converting with toDate, such as with this:

{{StartDate.toDate}}

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events