Friday, August 25, 2023

How to set user in "user picker" type field in JIRA based on text

 There was an issue to setup the user in the user picker type field by having only an e-mail of the user.

The plan:

1. pull out user without domain from the e-mail address

2. log through API to JIRA and make a query to find the selected user

3. pick the active selected user in the user picker field

The first point is rather easy stuff.

The second I needed to encode e-mail with api token to base64 and add that into webrequest header:
Add the Headers with Authorization Basic "<EMAIL>:<API_TOKEN>" encoded to base64.


The 3rd point. 



Useful links:

How to setup API tokens

How to send web reuqest using JIRA Rest API

How to setup value from text field into user picker field



No comments: