Forums

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

Custom field list with key value

Emil Emilsson September 26, 2022

The issue I need solved is this

 

There is a dropdown list with 30 different types of choices, each choice has a sentence or two I would like to insert into an email when this issue goes through a transition.

 

so I can set up an email template to get the selection from the dropdownlist but I need the associated email text.

 

How can I achieve this ?

 

Regards,

Emil

2 answers

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2022

Hi @Emil Emilsson 

With 30 values, the possible built-in solutions are going to be a bit brittle.  

For example, if you try this with an automation rule you probably cannot do this with a long if/else set of components as rules have a maximum number of around 60 components, and each option would take 2 components: the condition and setting a value.

A work-around would be to try a complex search/replace function, to substitute each possible value for your sentence.  And that would be quite difficult to maintain.

Kind regards,
Bill

Emil Emilsson September 26, 2022

Hi Bill,

 

if I were doing this in a software project, writing my own code I would just have a key value list where I would display a dropdownlist with the keys shown, as the keys are an abbreviation of the maintext, and then I would have the maintext as a string. So whatever you selected from the dropdownlist its value would be set as the text to use in the email.

Quite straight forward, but doing this in jira remains complicated.

 

Kind regards,

Emil

Like Bill Sheboy likes this
0 votes
Rilwan Ahmed
Community Champion
September 26, 2022

Hi @Emil Emilsson ,

You can make use of Jira automation send email Action in Issue transitioned trigger. 

In content you can make use of {{issue.customfield_10001}}, 10001 should be replaced by your custom field value. 

Emil Emilsson September 26, 2022

yes that solves the sending of custom text part.

 

the issue is 

I have a list of 30 items, one of which needs to be selected from a dropdownlist

id                emailtext

Fans           A very long text regarding fans that needs to be shown in email

Cars           A very long text regarding cars that needs to be shown in email if you select cars

 

would be nice if I had a dropdownlist fans, cars and more and when I selected one of them an associated value could be this long text

Rilwan Ahmed
Community Champion
September 26, 2022

Hi @Emil Emilsson 

Email will be sent with only the custom field's value, and not the available lists. 

Emil Emilsson September 26, 2022

What Im trying to avoid is sending 30 different emails types.

 

The emails differ between what you select from the dropdownlist

 

there is a part of the email that can be customized according to what you select in the dropdownlist so I could make that a variable and create one email template to use for all emails.

Emil Emilsson September 28, 2022

@Rilwan Ahmed Yes that is my problem, associated with each of those 30 choices is a sentence or two which I would like to include in the email.

 

I dont have any way of storing those sentences anywhere since dropdown lists are not key value pairs for one.

Rilwan Ahmed
Community Champion
September 28, 2022

Hi @Emil Emilsson ,

I did not understand what you mean by "30 choices is a sentence or two which I would like to include in the email".
Can you please share an example email template what you need as screenshot here ? 

Emil Emilsson September 28, 2022

Hi @Rilwan Ahmed ,

 

Let me try to explain to you in an abstract way what I am trying to do so you understand it better.

 

I have a workflow, and when an issue moves to the first rejected state an email will be sent to the issue participants explaning it was rejected.

there are 30 different reasons it can be rejected and so that I dont have to create 30 different email templates and send different emails based on what you selected in a dropdown list I figured I could have two sentences or thereabous for each reason then I could do a template which could insert the contents of that variable in the email template. Thus making it only one email template for the 30 options.

 

I had difficulty finding a place to store those 30 sentences so I figured I would use insight and create a table with the data and look it up via selection from the dropdown list.

 

My current problem is that I cannot figure out how to get the data from insight its not very straight forward.

 

hope this exlains it.

 

Regards,

Emil

Rilwan Ahmed
Community Champion
September 28, 2022

Hi @Emil Emilsson ,

When you reject the request, you select one reason from the 30 list ? Once you select a value in the Reject reason field, Jira saves the data. So in your send email automation, under content section you can add a sentence with variable like 

" Your request is rejected due to {{issue.customfield_10001}} "

Example: If your reject reasons are 
1. Out of Stock
2. In production
3. Not Available

  • When you select Out of stock in Jira reject reason field, them email will be sent to user as below: 
    " Your request is rejected due to Out of stock "
  • When you select Not Available in Jira reject reason field, them email will be sent to user as below:
    " Your request is rejected due to Not Available "
Emil Emilsson September 28, 2022

Hi @Rilwan Ahmed 

this would work if the rejection reason was a few words, but when its like a whole paragraph, I cannot put it in a dropdownlist for you to select from, its too long to properly display in a list like that.

 

if I had a dropdownlist that had like a display value and there could be a paragraph or long text associated with your choice in the dropdown and that text would be sent I would be golden.

 

Regards,

Emil

Rilwan Ahmed
Community Champion
September 28, 2022

@Emil Emilsson 

Even if your rejection reason is Paragraph- Multi line field (like comment), the  automation will get all the values you entered in the field and send in email. 

Attached is my email sent from Automation. I have marked my Reject reason field value

image.png

Below is the screenshot from the ticket where value is entered

image.png

Please create an automation rule, test and let me know how it goes. 

My automation rule is 

image.png

Emil Emilsson September 28, 2022

Yes I managed to get that automation working.

 

The issue is using hardcoded data or data from insight

here you can see an insight asset linked and I select the text from that dropdown list, this seems to be working ok. 

But how do I pull the selection data from this ?

 

I know the field is called "Email texti úr insight" I also know there is a field called Maintext that contains the text I want to use , so I somehow need to get the selected item from insight and put that in my maintext, how can I refer to it ? {{something?}}

image.png

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