Forums

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

Customer Account to User Picker Custom Field on Customer Portal

Alvin
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 Champions.
October 3, 2018

Hi Community, Is it possible to set default value in user picker custom field by the current user in customer portal? using behavior ?

Screenshot from 2018-10-03 11_29_58.pngI need to capture the current user on" Requested for " user picker custom field  like on the above "Raise this request on behalf of" system field.

 

I tried it using this behavior , place it on Initialiser, mapped to Service Desk Project, because I just want it to become a default value. but no luck, any chances? When I try to check the console in chrome (f12)

When user is admin account, it can capture the user and place on the field, but when the user is customer account, it returns this error

Screenshot from 2018-10-03 13_38_08.png

 Upon checking the behavior log , it returns this message:

2018-10-04 02:02:06,584 http-nio-8080-exec-8 DEBUG legoteam 122x13663x1 12ftncq 54.153.253.180,10.66.49.4 /rest/scriptrunner/behaviours/latest/jsd/jsd/validatorsByPid.json [c.o.j.groovy.user.FieldBehaviours] ------------------------TESTING BEHAVIOR-------------------------------

Upon checking /rest/scriptrunner/behaviours/latest/jsd/jsd/validatorsByPid.json, it returns this message:

"Cannot retrieve validators from PortalID: '{null}' , Request Type ID : '{null}'"

This is the code:

import com.onresolve.jira.groovy.user.FormField
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.component.ComponentAccessor

def requestorField = getFieldById("customfield_10385")

def currentUserName = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().getName()
requestorField.setFormValue(currentUserName)

2 answers

Suggest an answer

Log in or Sign up to answer
1 vote
PD Sheehan
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 Champions.
February 17, 2022

If you change the Status name from inside the workflow editor it will change that status EVERYWHERE including any other workflows that use this status. Existing filters and dashboards that point to x will break until you manually rewrite them to point to y.

Do this VERY carefully.

In most cases in a large instance with many projects and workflow, it is better to create a new status with the new name and adjust all the transition arrows to point to the new status, then delete the old status.

0 votes
Radek Dostál
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 Champions.
February 17, 2022

It will only remap the status in your existing workflows and issues, but it will not do anything with JQL or any automation you might have with the status name hardcoded.

JQL is stored as plain text, there is no reference to status in terms of statusid, so you need to update those manually.

Automation - this depends on the app and implementation. Generally if it's plain texted, then that falls to the manual category. If it's from a selector then more likely than not, it will be linked to statusId in the background so that should be fine. Again though, this depends on the vendor/implementation so no guarantees.

As for dashboard reports and board column mapping - my understanding is that those are linked by statusId, so they should be fine - it's just the jql.

In case of any doubts, you might want to confirm this on a test instance or with some test issue subset - none of these are exactly documented what will or will not map as far as I know, so it's more of a practice and general understanding of how things are connected to one another.

TAGS
AUG Leaders

Atlassian Community Events