Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

Info
title

Config summary

Here's what you will have after completing this guideline:

  • SIL aliases mapped with custom fields;

  • Workflow and Absences scripts ready. 

Info
title

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.

Adding SIL aliases

Info

SIL aliases are a mapping between a nickname and a custom field id. This makes the scripts easier to read and protects them from breaking if someone renames a custom field. 

The following SIL aliases need to be added for each of the custom fields used by this integration. In order to do that, follow the steps below.

  1. Go to Jira administration > Manage apps > SIL Manager.

  2. Select 'SIL Aliases' tab on the right-hand side of the SIL Manager window and click the '+' icon to add a new entry. 
    Image Modified

  3. Add the following aliases: 

Alias

Custom Field

absenceType

Absence Type

reason

Reason/Comment

manager

Manager/Approver

startDate

Start date

endDate

End date

Info

It may happen for your Jira instance to have more than one field named Start date or End date. In this case, identifying the right ids of BigPicture Start and End date fields from the 'SIL Aliases' tab will rather be tedious. Instead, you may use the following method.

  • Go to Jira administration > Issues > Custom fields.
  • Search for the date field (look for description field used by SoftwarePlant plugins). 
  • Click on the cog wheel icon and hover over 'Configure'. The custom field id should show up in the address at the very bottom of the page. 

...

Once done

...

adding aliases, the mapping

...

will be displayed

...

as pairs of aliases and respective custom field

...

IDs.

...

...

Creating file tree

  1. Navigate to Jira administration > Manage apps > SIL Manager.

...

  1. 27.pngImage Added
  2. Right-click on the 'silprograms' folder, click

...

  1. 'New', and select 'File'. 

...

  1. 28.pngImage Added
  2. Name it "createFiles.sil" and click the tick to apply changes. 

...

  1. 29.pngImage Added
  2. Copy the below code and paste it over to the script field. 

...

  1. 30.pngImage Added
    Code Block

...

themeConfluence
  1. createDirectory("BigPicture");
    createDirectory("BigPicture/Absences");
     
    string [] files = "functions.incl|structs.incl|types.csv";
    for(string f in files) {
        createFile("BigPicture/Absences/" + f);
    }
     
    createDirectory("BigPicture/Absences/Workflow");
     
    files = "assignManager.sil|recordAbsence.sil|validator.sil";
    for(string f in files) {
        createFile("BigPicture/Absences/Workflow/" + f);
    }

...

  1. Image Added
  2. Click on a green button to run the code.

...

  1.  

...

  1. 31.pngImage Added


    You should see the following confirmation

...

  1. afterward.

...

  1. 33.pngImage Added

  2. Right-click on the 'silprograms' folder again and hit 'Refresh'. 

...

  1. 34.pngImage Added


    The following folder tree along with some empty script

...

  1. files should be created.

...

  1. 35.pngImage Added
  2. Use the right click and the 'Delete' option to remove the 'createFiles.sil' script as it is no longer needed. Click 'OK' when prompted to confirm the action. 

...


...

  1. 36.pngImage Added

Configuring Workflow and Absences scripts

Each script can be opened e.g. in in TextEdit (for Mac) or any other text editor.Image Removed

...

assignManager.sil (download file)

  1. Once opened in a text editor, copy the script text and paste it into the corresponding file from under the 'Workflow' folder in the SIL Manager. 

...

  1. 38.pngImage Added


  2. Make sure to save the changes.

...


  1. 39.pngImage Added


    You should be presented with a green 'Save done' text afterwards.

...

  1. 40.pngImage Added

recordAbsence.sil (download file (BigPicture 8.0.X - 8.2.X) | download file (BigPicture 8.3.X and later))

  1. Once opened in a text editor, copy the script text and paste it into the corresponding file from under the 'Workflow' folder in the SIL Manager. 

...

  1. 41.1.pngImage Added


  2. Hit '⌘ + f' (for Mac) to use the search and

...

  1. type customfield_XXXXX. There should be 5 items found.

...

  1.   

...

  1. 42.pngImage Added

  2. Click on the 'SIL Aliases' tab on the right. Then, for each of the custom fields from the code lines below, find their ids and swap

...

  1. with XXXXX

...

  1.  in the script code.

Code line

SIL alias

date

...

start

...

=

...

toTimeZone(customfield_XXXXX,

...

"GMT+1")

startDate

a.typeId

...

=

...

types[customfield_XXXXX].id

absenceType

a.startDate

...

=

...

formatDate(toTimeZone(customfield_XXXXX,

...

"GMT+1"),

...

dateFormat)

startDate

a.endDate

...

=

...

formatDate(toTimeZone(customfield_XXXXX,

...

"GMT+1"),

...

dateFormat)

endDate

a.comment

...

=

...

customfield_XXXXX

reason


For example,

...

for Start date, this should look like below. 

...

  1. Once you have

...

  1. these XXXXXs all swapped with custom field ids, save the script.

...

  1. 46.1.pngImage Added

    You should be presented with a green 'Save done' text

...

  1. afterward.

    46.1.pngImage Added

Code line

SIL alias

date start = toTimeZone(customfield_XXXXX, "GMT+1")

startDate

a.typeId = types[customfield_XXXXX].id

absenceType

a.startDate = formatDate(toTimeZone(customfield_XXXXX, "GMT+1"), dateFormat)

startDate

a.endDate = formatDate(toTimeZone(customfield_XXXXX, "GMT+1"), dateFormat)

endDate

a.comment = customfield_XXXXX

reason

validator.sil (download file)

  1. Once opened in a text editor, copy the script text and paste it into the corresponding file from under the 'Workflow' folder in the SIL Manager.

...

  1. 49.pngImage Added

  2. Make sure to save the changes.

...

  1. 50.pngImage Added

    You should be presented with a green 'Save done' text

...

  1. afterward.

...

  1. 51.pngImage Added

types.csv (download file)

  1. Once opened in a text editor, copy the text and paste it into the corresponding file from under the 'Absences' folder in the SIL Manager.

...

  1. 71.pngImage Added
  2. Make sure to save the changes.

...

  1. 72.pngImage Added

    You should be presented with a green 'Save done' text afterwards.

...

  1. 73.pngImage Added

structs.incl (download file)

  1. Once opened in a text editor, copy the script text and paste it into the corresponding file from under the 'Absences' folder in the SIL Manager.

...

  1. 74.pngImage Added


  2. Click on a green button to run the code.  

...

  1. 75.pngImage Added


    You should see the following confirmation afterwards.

...

  1. 76.pngImage Added
  2. Make sure to save the changes.

...

  1. 77.pngImage Added

    You should be presented with a green 'Save done' text afterwards.

...

  1. 78.pngImage Added

functions.incl (download file (BigPicture 8.0.X - 8.2.X) | download file (BigPicture 8.3.X and later))

  1. Once opened in a text editor, copy the script text and paste it into the corresponding file from under the 'Absences' folder in the SIL Manager.

...

  1. 49.pngImage Added
  2. In the highlighted two lines, swap the default credentials (dastin/Pas$$word) with the username and password of a Jira user that will be used to make the REST calls to BigPicture. 

...

  1. (info) Info: It is recommended that a new Jira user with Jira System Administrators or Jira Administrators global permission be created as a service account so that password changes do not impact the functionality of this script.

...

  1. Image Added

    For the purpose of this user manual, we used Jira admin account. 

...

  1. 70.pngImage Added
  2. Click on a green button to run the code.  

...

  1. 75.pngImage Added

    You should see the following confirmation afterwards.

...

  1. 76.pngImage Added

    Once this script has been run successfully for the first time the username and password used will be stored permanently as a persistent variable. This can be seen in the 'Persistent vars'

...

  1. tab on the right-hand side of the SIL Manager.

...

  1. 81.pngImage Added

    As soon as you confirm that these are stored there, you can modify the script

...

  1. so that the credentials are not visible in the code itself. For this, we used getPersistentVar routine.

...

  1. 154.pngImage Added
  2. Make sure to save the changes. 

...

  1. 155.pngImage Added
  2. You should be presented with a green 'Save done' text

...

  1. afterward.

...

  1. 156.pngImage Added