"Absences" project configuration
Config summary
Here's what you will have after completing this guideline:
A dedicated issue type associated with your absences Jira project;
A new field configuration and field configuration scheme configured and associated with your absences Jira project;
Project screens for both 'Create' and 'Edit/View Issue' operations set up;
A new Power Scripts listener;
Project workflow configured to match the integration scripts.
Required permissions
Requires either Jira System Administrators or Jira Administrators global permission. If you don't have such privileges, ask your Jira administrator for help.
Switch current project issue types to "Absence Request" type
Open "Absences" project and jump to 'Project settings'. From there, select 'Issue types'.
Expand 'Actions' drop-down menu in the top right and select 'Edit issue types'.
Click 'Remove all' to move all of the current project issue types to 'Available Issue Types' list (1). Afterwards, they will no longer be used by the project. Next, find the "Absence Request" issue type on the 'Available Issue Types' list. Drag and drop it onto the 'Issue Types for Current Scheme' list (2).
Scroll down and click 'Save'.
You should end up with your project issue types configured as shown below.
Configure project field configuration
Considering a typical Jira instance may have more than one Jira project associated with the default field configuration, it is recommended for this integration to associate a different field config with the "Absences" project. This is because we'll make some of the custom fields required and want this change not to affect any other Jira project.
Go to Jira administration > Issues > Fields > Field configurations. For the field config currently used by the "Absences" project click 'Copy'.
Change the name and description of a field config copy. Description field may be left empty. Once done, click 'Copy'.
Click 'Configure' for the recently copied field config.
For Absence Type, Manager/Approver, Start date and End date custom fields, click 'Required'. You may use '⌘ + f' to find the fields easier.
Once done, you should see 'Required' lozenge right next to the custom fields name.Next, jump to the 'Field configuration schemes' screen and click 'Add field configuration scheme' in the upper right.
Give it the "Absences" name and click 'Add'. Description field may be left empty.
Right after, click 'Edit' under Actions.
Switch the field configuration to the 'Absences' config created in step (2). Next, click 'Update'.
Go back to the "Absences" project settings and jump to the 'Fields' screen.
Expand 'Actions' drop-down menu in the upper right and select 'Use a different scheme'.
Switch the scheme to the 'Absences' entity added in step (6) and click 'Associate'.
As a final result you should see the 'Absences' scheme associated with the "Absences" project.
Set up project screens
Open "Absences" project and jump to 'Project settings'. From there, select 'Screens'.
Open the screen for the 'Create Issue' operation.
Remove all of the fields from the Create Issue screen except for the 'Summary' field.
Find and add the following custom fields: Manager/Approver, Absence Type, Reason/Comment, Start date, End date.
Go back to the 'Screens' and open the screen for the 'Edit/View Issue' operation.
Redo the step (3). Later, find and add the following custom fields: Manager/Approver, Absence Type, Reason/Comment, Attachment, Start date, End date. We've added the 'Attachment' field so that users could attach doctors notes or additional files as needed.
Go to Jira administration > Manage apps > Power Apps Config > Power Scripts > Listeners. There, click 'Add listener'.Next, select the Issue events the script should fire on, i.e. Issue Created, Issue Updated, as well as the "Absences" project it should be applicable to. Later, click the pencil icon to select the 'assignManager.sil' script.
Once script has been selected, click 'Add' to add a listener.
You should end up with a listeners config looking like this.
Set up project workflow
Open "Absences" project and jump to 'Project settings'. From there, select 'Workflows'.
Click on the pencil icon under 'Actions'. This will take you to the workflow designer screen.
Switch to 'Diagram'.
For the purpose of this user manual, we went ahead and redesigned the default project workflow so that it is simple and straightforward.
Select the 'Approve' transition and click 'Validators'.
Click 'Add validator'.
Select 'SIL Validator' and click 'Add'.
Choose 'Existing Script' and click 'Next'.
Click on the pencil icon to select script.
Expand 'silprograms' folder and go down to 'Workflow'. Then, select 'validator.sil' and click the 'Select' button.
At the end, click 'Finish'.
Repeat the process but add 'recordAbsence.sil' script as another validator.
Go back to the workflow designer, select the 'Approve' transition again and click 'Post Functions'.
Click 'Add post function'.
Select 'SIL Post-function' and click 'Add'.
Choose 'Existing Script' and click 'Next'.
Click on the pencil icon to select script.
Expand 'silprograms' folder and go down to 'Workflow'. Then, select 'assignManager.sil' and click the 'Select' button.
At the end, click 'Finish'.
Use the down arrow to move the script entry to the very bottom of the list so that it becomes last in order. After that, publish the workflow by clicking 'Publish'.