It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How set assignee using SIL script with kepler pro?

Begoña Bonet Dec 21, 2015

I've a KCF Single Autocomplet customfield whith this Select script:

 

KPOption[] kpOpt = #{Seleccionar técnico soporte};

string seleccion = kpOpt[0].value;

customfield_11904=seleccion;
assignee="admin";

 

The customfield_11904 has the rigth value but the field assignee remains empty. What am I doing wrong?

 

2 answers

0 votes
Alexandra Topoloaga Dec 21, 2015

Hi Begoña,

Try this: assignee=getUser("admin");

 

Begoña Bonet Dec 21, 2015

It doesn't work for me :-(

Alexandra Topoloaga Dec 21, 2015

Is the script above the select script or the datasource? If it is the select script, how does the datasource looks like? Is customfield_11904 your KCF Pro? You want to set the assignee to an user which has admin as username? Please be more specific. Thank you, Alexandra

Begoña Bonet Dec 21, 2015

My KCF Pro is customfield_20901. It's datasource script is: string grupo_soporte = argv["customfield_20900"]; //Seleccionar grupo soporte string query = "SELECT "; query += " display_name||' ['||user_name||']' nombre"; query += " from cwd_user u"; query += " LEFT JOIN cwd_membership g ON u.ID = g.child_id"; query += " WHERE parent_name='"+grupo_soporte+"'"; query += " order by u.user_name"; string[] resultado = sql("JiraDB",query); return resultado; The customfield_11904 is a customfield that I've to fill depending on the value of the KCF. Thus, the select script of my KCF (customfield_20901) is: KPOption[] kpOpt = customfield_20901; string seleccion = kpOpt[0].value; customfield_11904=seleccion; assignee=getUser("admin"); I'm testing with this simple values (seleccion and "admin")

Begoña Bonet Dec 21, 2015

"admin" is a username

Alexandra Topoloaga Dec 21, 2015

I have just tried what I suggested you and it works. Could you please set the LOG level to debug and check if there's anything relevant? :)

Alexandra Topoloaga Dec 21, 2015

Actually, it also works with assignee = "admin". Waiting for the LOG. :)

Begoña Bonet Dec 21, 2015

In the log I can see: In the log I can found: 2015-12-21 15:03:59,998 http-bio-8080-exec-3 DEBUG bonet_beg 903x21201x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [jira.commons.ivm.SILIssue] Field customfield_20901 was not modified. Current value: [KPOption[]] {[Inmaculada Sanchez [sanchez_inm], Inmaculada Sanchez [sanchez_inm]]}. Issue value : [KPOption[]] {[Inmaculada Sanchez [sanchez_inm], Inmaculada Sanchez [sanchez_inm]]} 2015-12-21 15:03:59,998 http-bio-8080-exec-3 DEBUG bonet_beg 903x21201x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [jira.commons.ivm.SILIssue] Retrieving field assignee from issue AXIS-39262 2015-12-21 15:03:59,998 http-bio-8080-exec-3 DEBUG bonet_beg 903x21201x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [jira.commons.ivm.SILIssue] Value of assignee on issue AXIS-39262 is [STRING] 2015-12-21 15:03:59,998 http-bio-8080-exec-3 DEBUG bonet_beg 903x21201x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [jira.commons.ivm.SILIssue] Saving to issue AXIS-39262 field assignee with value [STRING] admin|admin|admin|dgti@excentia.es 2015-12-21 15:03:59,999 http-bio-8080-exec-3 DEBUG bonet_beg 903x21201x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [jira.commons.ivm.SILIssue] Retrieving field key from issue AXIS-39262 2015-12-21 15:03:59,999 http-bio-8080-exec-3 DEBUG bonet_beg 903x21201x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [jira.commons.ivm.SILIssue] Value of key on issue AXIS-39262 is [STRING] AXIS-39262 2015-12-21 15:03:59,999 http-bio-8080-exec-3 DEBUG bonet_beg 903x21201x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [jira.commons.ivm.SILIssue] Field key was not modified. Current value: [STRING] AXIS-39262. Issue value : [STRING] AXIS-39262 2015-12-21 15:04:00,000 atlassian-scheduler-quartz1.clustered_QuartzSchedulerThread DEBUG [quartz.impl.jdbcjobstore.SimpleSemaphore] Lock 'TRIGGER_ACCESS' is desired by: atlassian-scheduler-quartz1.clustered_QuartzSchedulerThread 2015-12-21 15:04:00,000 atlassian-scheduler-quartz1.clustered_QuartzSchedulerThread DEBUG [quartz.impl.jdbcjobstore.SimpleSemaphore] Lock 'TRIGGER_ACCESS' is being obtained: atlassian-scheduler-quartz1.clustered_QuartzSchedulerThread 2015-12-21 15:04:00,000 atlassian-scheduler-quartz1.clustered_QuartzSchedulerThread DEBUG [quartz.impl.jdbcjobstore.SimpleSemaphore] Lock 'TRIGGER_ACCESS' given to: atlassian-scheduler-quartz1.clustered_QuartzSchedulerThread 2015-12-21 15:04:00,007 http-bio-8080-exec-3 DEBUG bonet_beg 903x21201x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [plugins.databasecf.config.ConfigurationCache] Loaded configuration >>databasecf.View Type_11904<< (1) 2015-12-21 15:04:00,017 http-bio-8080-exec-3 DEBUG bonet_beg 903x21201x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [commons.jira.utils.IssueUtils] Updated issue >>AXIS-39262<< The most relevant thing for me is: 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [jira.commons.ivm.SILIssue] Saving to issue AXIS-39262 field assignee with value [STRING] admin|admin|admin|dgti@excentia.es I think I need to get only the username. Doesn't it?

Begoña Bonet Dec 21, 2015

Using: assignee="admin"; I can see in the log: 2015-12-21 15:11:26,785 http-bio-8080-exec-21 DEBUG bonet_beg 911x21502x1 i1xbn2 10.178.169.107,10.178.169.107,172.27.146.22 /secure/CommentAssignIssue.jspa [jira.commons.ivm.SILIssue] Saving to issue AXIS-39262 field assignee with value [STRING] admin The problem is that my issue remains without value for "assignee" :-(

Alexandra Topoloaga Dec 21, 2015

It all looks all right to me, I don't get why the value isn't set. It's ok to use the username, yes.

Alexandra Topoloaga Dec 21, 2015

The new value doesn't appear neither after you refresh the page?

Begoña Bonet Dec 21, 2015

no, and if I launch a JQL like "project=AXIS and assignee=admin" no issue is found.....very strange

Alexandra Topoloaga Dec 21, 2015

Hmm... indeed, I don't get why the assignee isn't set.

0 votes
Mariusz Piotrowski Feb 15, 2016

I have resolved same issue using those two lines:

KPOption [] assigned = customfield_10501; //This is KCF Pro single autocomplete field

assignee = assigned[0].value;

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

736 views 7 0
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you