Automation + Protected Fields
How to set Protected Field via Automation.
To do this you must use an Unencrypted field, this because there is no encryption method in automation that can be used at the moment.
Edit Issue
In automation select edit issue action and use the following syntax
{
"fields":
{
"customfield_10138": "Hello World!"
}
}
Example above sets a Protected Text Field Unencrypted to Hello World!
{
"fields":
{
"customfield_10138": {{#=}}{{issue.Quantity}}*{{issue.Unit Amount}}{{/}}
}
}
Example above sets a Protected Number Field Unencrypted to the Quantity
times Unit Amount
field values.
Copy Protected Field Date to Due date on change
This example is used when due date should be in sync with a Protected Field, to ensure consistency remove the due date field from the edit/create screen.
Add an automation rule that triggers on Field change and select the Protected Date Field as the trigger field and the Edit Issue as For event. This will make automation to trigger whenever a Protected Field Date is updated.
Add an Edit issue action and select Due date as field, in the value box enter the syntax below.
{{issue.Unencrypted Date Field.date}}
Note that your field name will differ from Unencrypted Date Field
and .data need to be in the end of the field name.
Set a default date on a Protected Field - Unencrypted Date type
This example takes the current date and set that as the date on a Protected Field unencrypted date type.
Create an automation and choose Issue Created as trigger
Add an Edit Issue action with the following body. Be sure to replace the customfield_10140 with your field ID.
Automation + Protected Fields API adding value to PF
Add a automation rule
Select trigger, like Created, Updated or Commented
Add a condition when to run the automation
Add a Webhook action
Set Method to POST and URL to the URL found in Protected Fields api admin page.
Generate an API token and add the token to the URL such as pfURL?token=yourtoken&issueKey={{key}}Add the Body
Copy PF Multiuser Encrypted to Jira User Picker
Add a automation rule
Select trigger, like Created, Updated or Commented
Add a condition when to run the automation
Add a Webhook action
Set Method to GET and URL to the URL found in Protected Fields api admin page.
Generate an API token and add the token to the URL such aspfURL?token=yourtoken&issueKey={{key}}&fieldId=customfield_xyz
customfield_xyz is the PF Multi-user fieldCheck the delay execution until response checkbox
You can test this by adding an issue key that has the field on it
Add a Edit Issue action
Enter the following body. Change the Approvers field to the field you want to add the users to
Click Save and publish
This will now fetch the field value from the API and put it into a multi-user field.
Add PF Multiuser Uncrypted to Jira User Picker
Add a automation rule
Select trigger, like Created, Updated or Commented
Add a condition when to run the automation
Add a Edit Issue action
Enter the following body. Change the
Approvers
field to the field you want to add the users to and theUnenc multi user
to the PF unecrypted user pickerClick Save and publish