Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using Custom Date field in a Slack message

Chris Machnicki November 10, 2020

Hi all,

I have a custom short date field on my form called "Start Date" and want to pass this through as a slack message to advise when an employee is due to start.

 

In the message I have tried {{issue.start date}}, {{issue.fields.start date}} and formatting the date but the message which is received is missing the date off.

 

Other fields pass through e.g. Full Name passes through as {{issue.Full Name}}.

 

Any ideas?

 

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 10, 2020

Hi Chris,

Generally calling {{issue.Field Name}} should display the field with no problem in its default format (although you can reformat dates as you need). By just calling a date, you'll get yyyy-mm-dd in Slack:

image.png

 

The tricky bit here is that "Start date" is also the name of a default field created by Jira. Likely you've added a custom field of "Start date" to your issue, whereas Automation will be trying to use the system-created "Start date" field.

To fix this, you could:

  • Rename your custom field, and update your automation rule to use the new field name
  • Call the custom field in the automation rule by using its ID rather than name:
    {{issue.fields.customfield_10040}}
    (replacing the ID at the end with the ID of your custom field)

Don't know the custom ID? You can find it in the same place you'd rename the field:

  1. Navigate to Administration >> Issues >> Custom Fields.
  2. Find the custom field and click the '...' menu on the right side, then select "Edit Details" option in the dropdown.
  3. Observe the URL and see the ID at the end. Example:

    (info) The id for this custom field is 10006

That should patch things up! In a next-gen project, Jira will prevent you from creating a field that has a duplicate name. But I'm guessing you're working with a classic project, and were able to create a custom field with the same name as an existing system field.

Cheers,
Daniel

Chris Machnicki November 11, 2020

Hi and thanks for your reply.

 

It looks like you are probably right that there is a conflict with the start date of the system and this field being called start date too. I changed the name in the request type form and updated the slack message to match and it came through. Now I can work on the formatting!

 

One thing though - This is a next-gen project so it doesn't look like it prevented this from being set up like you said - hopefully this can help someone else as I spent hours trying to figure out what I was doing wrong. 

 

Retrospectively I wish I'd set it up as an old project now - even though it's harder to configure, it offers a lot more.

 

Cheers!

Suggest an answer

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

Atlassian Community Events