how can i set a default value in the user picker while doing transition in workflow

rTrack Support
Contributor
October 5, 2016

we are  using the customized workflow .

we have to set a user value to the user picker while doing the transition based on the other fields .

we are using the username as same as ours employee code  . so it is like 10000 for example .

how can i set this numerical value in user picker .

if it is not possible with numerical value then is it possible with alphabets ??

please let us know .

we have to set the value based on ur suggestion 

Note :

field is combo value and setting to user picker

 

2 answers

1 accepted

1 vote
Answer accepted
Fidel Castro
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.
October 5, 2016

Sorry, there are some aspects of your question that I don't understand. Please, tell me:

  1. In JIRA you can set the user's full names to the actual name of the employee, while the username can be a numerical code corresponding to your internal employee code. Is this your case?
  2. Does the combo custom field (Select List in JIRA terminology) you talk about in your description contain the numerical employee code?
  3. If the answer to question 2 is 'yes', then: Do you want to set the User Picker custom field with the user that corresponds to the employee code selected in the combo field?

Please, answer these 3 questions and I will be able to help you.

 

rTrack Support
Contributor
October 5, 2016

Scenario first is ours .

username :empcode:10000

Fullname :Vijaya bhaskar v

Email id :vijay@ramco,com

we are configured using JIRA internal directory only .

Select list field having the following values :

 

Present Team : DW,Technology,Delivery etc ..

 

Based on present team we need to assign the default user value to the advanced user picker

that user picker is configured based on the project role present in the project .

 Compare Field : Present Team

Target Field :Support Person

 

(DW)10000

(Technology)10001

 

Support Person is the user picker field .

Present Team is the single select list (JIRA custom field )

Do u need any other clarifications ???

 

Fidel Castro
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.
October 5, 2016

After your description I still don't know whether the username is empcode:10000 or simply 10000. Please, tell me which is the correct one.

rTrack Support
Contributor
October 5, 2016

simply 10000 only .

rTrack Support
Contributor
October 5, 2016

10000

 

Fidel Castro
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.
October 5, 2016

Then you should use "Set a field as a function of other fields" post-function of JIRA Workflow toolbox with a configuration like this:

Captura de pantalla 2016-10-06 a las 10.56.08.png

The last setting rule (i.e., (.*)20000) is optional. This setting sets a default user for the case when the value selected in Present Team is not matched for any of the previous setting rule, i.e., is a kind of 'else' in an if-then-else sentence.

 

rTrack Support
Contributor
October 5, 2016

I have configured like this only . But it results error  while doing the transitions .

 

Fidel Castro
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.
October 5, 2016

Which kind of error? Please, give me more details about it.

Which version of JIRA and JIRA Workflow Toolbox are you using?

Fidel Castro
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.
October 6, 2016

Ok. Now I know the cause of the problem: the value is being treated as a number instead of a string. You can solve the problem forcing the value part of the rule to be treated as a string. To do it use the following setting rules:

a(DW)"10000"
a(Technology)"10001"
a(Delivery)"10002"
a(.*)"20000"

The 'a' prefix forces the value part to be treated as a text expression, for this reason we write the string literals between double quotes.

rTrack Support
Contributor
October 6, 2016

Hi Fidel ,

Great work ..

Its working fine now .

Thanks for the immediate support .

 

rTrack Support
Contributor
October 6, 2016

can you share the tricks like this ....

rTrack Support
Contributor
October 10, 2016

Hi Fidel ,

I have one small doubt .Can you please clarify that ..

is it possible to set a field value based on more than one fields .

Field 1:In Progress (select field ) : DW,Runtime,Tech

Field 2 : Internal Status(dw) (select field) : Open ,Allocated

Field 3 :Support Person (dw) (user picker)

Field 4 :Active Person (picker)

I have to check the two fields field 1 & 2  and then need to copy the field 3 value into field 4 . 

 

 

 

Fidel Castro
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.
October 11, 2016

Yes, it's possible. There are more than one way to do it. For example, it can be done using "Set a field as a function of other fields" post-function with type 2 setting rules. These type of rules use the following format

[boolean_expression]value

some examples of setting rules:

a[%{12000} = "DW" AND %{12001} = "Open"]"10000"
a[%{12000} = "Runtime" AND (%{12001} = "Open" OR %{12001} = "Allocated")]"10001"
a[{12000} = "Tech" OR %{12001} != "Open"]"10002"

in the example %{12000} is the field code for Field 1 and %{12001} is the field code for Field 2.

If you have difficulties to implement your requirements, please explain in detail the behavior you want to implement and I will give you the exact setting rules to use.

rTrack Support
Contributor
October 11, 2016

Yah sure Fidel .

I will implement it and revert if any issues found in the implementation .

Thanks for the immediate support .

 

 

rTrack Support
Contributor
October 11, 2016

In this scenario i have to choose the two fields right ??

target field is the field 4 .

field to check : ???

which field i need to choose here 

shall i need to use the field 1 or leave it as default (summary ) field .

Fidel Castro
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.
October 11, 2016

Parameter Field to be checked... is only used for Type 1 setting rules. Since you are only using Type 2 setting rules, the value selected in this parameter doesn't matter.

0 votes
rTrack Support
Contributor
October 5, 2016

ERROR.png

Suggest an answer

Log in or Sign up to answer