Forums

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

Jira automation - maps

Andrey Kiyanovsky
Contributor
October 14, 2022

Dear community,

I can't find how to implement in Automation for Jira an advanced smart value similar to this in JavaScript

{1: 'aaa', 2: 'bbb'}[x]

i.e. it's a simple mapping.

I know I can use if/else, but it will duplicate actions in the rule.

Any thoughts?

 

 

1 answer

1 vote
Callum Carlile _Automation Consultants_
Community Champion
October 14, 2022

Hi @Andrey Kiyanovsky

If you're using smart values for fields then they will take the format of {{issue.customfield_id}}. Are you using these in the advanced compare condition? Are there any error messages in the audit log which might be of use?

Andrey Kiyanovsky
Contributor
October 14, 2022

No, I'm not using custom fields. I need to determine a target project based on the source, something like this

{'projectX': 'projectY', 'projectA': 'projectB'}[{{issue.project.key}}]

Callum Carlile _Automation Consultants_
Community Champion
October 14, 2022

What is your trigger for the rule/in what context are you needing the source/trigger project? E.g. is it based on issues in separate projects being linked, where you're trying to find the trigger/destination projects of the issues being linked? Or are you moving issues from one project to another?

Andrey Kiyanovsky
Contributor
October 14, 2022

It doesn't matter, for example, events is happeing in project A and something has to be done in project B and I have several mapping pairs. I need a mapping to figure out a target project based on the source, e.g.

project1 → project2

projectA → projectB

That's it.

I'm not looking for workaround, I'm looking for a smart value that will allow me to do that. As far as I can see, Automation for Jira can't work with user-defined maps.

Callum Carlile _Automation Consultants_
Community Champion
October 17, 2022

Got it, I see what you mean now - it sounds like the mapping you are wanting is not really easily achievable in Automation for Jira, like you say, without using a bunch of IF statements

Suggest an answer

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

Atlassian Community Events