- marked as task
- edited description
Set Component value based on a values of two custom fields
Hi,
I'm struggling the last 2 days to automatically set the Component field based on the values of two single value custom fields.
For example:
Selected Custom Field 1: "A" Selected Custom Field 2: "B"
Component should be assigned as "A - B"
Value "A - B" is valid and exists for the component.
I tried several options using "Copy a parsed text to a field" but couldn't make it work.
Any help would be highly appreciated.
Thanks, George
Comments (7)
-
reporter -
repo owner Hi George,
You should use the following configuration:
Text to be parsed used is:
%{12900} - %{12901}
IMPORTANT: Beware not to insert undesired whitespaces.
Note that:
- %{12900} is field code for A
- %{12901} is field code for B
Once configured, post-function looks like this:
An example of the result:
These are the components in the project:
Regards,
Fidel
-
reporter Many thanks Fidel for the prompt detail reply. It turned out to be a stupid mistake of the hyphen defined under the components and the one used in the rule. Component was defined as A – B and in the rule I used: A - B. The difference between – and - costed me 2 days of my life :)
Regards, George
-
repo owner - changed status to resolved
Great! Don't hesitate to ask for support next time.
-
reporter Since you ask... one last thing. I would like to add an IF-THEN-ELSE condition as well when returning the Component value. However the below doesn't work (11252 and 11253 are the custom single value fields). Any ideas?
%{11253} != "" ? %{11252} - %{11253} : %{11252}
-
repo owner You should use of advanced parsing mode and one of these expressions:
%{11253} != "" ? %{11252} + "-" + %{11253} : %{11252}
or
%{11253} != null ? %{11252} + "-" + %{11253} : %{11252}
Both expressions are equivalent.
-
reporter Perfect! It worked now!
Cheers, George
- Log in to comment