44. Basics
UI changes for JIRA & Confluence
Escalation Service
Event Handlers for Confluence and JIRA
Two Simple (but useful) Behaviours
Outline
45. Basics
Terminology:
Built-in Scripts (admin link) vs Canned Scripts (conveniently located scripts within most of the
different SR functions
Behaviours – Control how fields “behave” during issue transitions
Workflows – Conditions / Validators / Post-Functions
Script Fragments – Customising Atlassian product UI’s
Escalation Service – set conditions for running scripts automatically
Event Handlers – Scripts that respond to hundreds of events in Bitbucket, Confluence & JIRA
Workshop material like groovy files and links: https://hub.adaptavist.com/SRoT17
Doco Link: https://www.adaptavist.com/doco/display/SFJ/How-to+articles
46. UI Change in JIRA
Hiding UI Elements - <SR documentation link>
47. UI Changes (… Continued)
SR Doc’n link: https://scriptrunner.adaptavist.com
61. UI Changes
Hiding UI Elements https://scriptrunner.adaptavist.com/latest/jira/fragments/HideUIElement.html
Module key: com.atlassian.jira.system.issueoperations:attach-file …..
Copy Project UI
Section: browse_link/project_new
Condition: user should be a member of the Administrator group
Copy Project link (full
path): …../plugins/servlet/scriptrunner/builtin?section=builtin_scripts#com.onresolve.scriptrunner……CopyProject.groovy?
Copy Space UI
Section: TBD/space_new?
Condition: user should be a member of the Administrator group
Copy Space link Find the path by running the Built-in Script
CopySpace.groovy
Approve a Confluence page
Script Fragment: ApproveConfluencePage.groovy
REST Endpoint:
Escalation Service
Auto Approve after 2 days: status = “Awaiting Approval” and Approved = “No” and updated <-2d
Auto Approve Link: https://www.adaptavist.com/doco/SFJ/KB …..
Additional issue actions (snippet): SetFieldAndComment.groovy
Files used in this workshop
62. Event Handlers
Create a JIRA Project from Confluence
https://scriptrunner.adaptavist.com/latest/confluence/interacting-with-jira-from-confluence.html
EventHandlerPageInlineCommentGuardian.groovy - responds to a page create or update event on Confluence and Uses a simple Regular
Expression set of definitions and suggests alternatives as an Inline comment on the Confluence Page
https://scriptrunner.adaptavist.com/latest/confluence/ConfluenceEventHandlers.html
Behaviours
BehaviourHalfDaySetDateFields.groovy - changes the behaviour of a Custom Field (End Date) to Read-only if checked
Scripted Field
ScriptedFieldDaysRequested.groovy - Calculates the number of working days (excludes weekends) between Start and End Date fields
Post-Function
PostFunctionSetDescriptionIfLeftBlank.groovy - sets a friendly description if it is left blank and uses Start and End Date Custom Fields
PostFunctionLogTimeAutomatically.groovy - logs 8 hours each working day from Start to End Date Custom Fields
Files used in this workshop …
63. ScriptRunner On Tour 2017
Slides and files will be made available soon
http://hub.adaptavist.com/SRoT17
Offer for Attendees only:
50% discount (1st year only)
New purchase for SR4BB, SR4C or SR4J
Why not go for all three!
Please Evaluate first
then contact
licensing@adaptavist.com
Where Can You Get this?
70. Maintaining Confluence
What happens?
• Hundreds of spaces
• 1 Million+ pages
Huge “spring clean”
• How do you contact all of the Content
Authors?
• Are they even still at your Company
• Which spaces do you archive?
• How do you decide if a page is still
relevant or useful?
72. My future pool
Helps you naturally clean itself
Script Jobs
• Automatically pruning old versions and comments (Script Jobs)
• Identify content authors that have left your company
• Set reminders to check “old” content
Event Handlers
• Check your content
• Extends the Create Space and User
Built-in Scripts
• Change Content Authors
76. Escalation Service
Auto Approve after 2 days: status = “Awaiting Approval” and Approved = “No” and updated <-2d
Auto Approve Link: https://www.adaptavist.com/doco/SFJ/KB …..
Additional issue actions (snippet): SetFieldAndComment.groovy
Event Handlers
Create a JIRA Project from Confluence
https://scriptrunner.adaptavist.com/latest/confluence/interacting-with-jira-from-confluence.html
EventHandlerPageInlineCommentGuardian.groovy - responds to a page create or update event on Confluence and Uses a simple Regular
Expression set of definitions and suggests alternatives as an Inline comment on the Confluence Page
https://scriptrunner.adaptavist.com/latest/confluence/ConfluenceEventHandlers.html
Scripted Field
ScriptedFieldDaysRequested.groovy - Calculates the number of working days (excludes weekends) between Start and End Date fields
Post-Function
PostFunctionSetDescriptionIfLeftBlank.groovy - sets a friendly description if it is left blank and uses Start and End Date Custom Fields
PostFunctionLogTimeAutomatically.groovy - logs 8 hours each working day from Start to End Date Custom Fields
Slides and useful links …
77. UI Changes
Hiding UI Elements https://scriptrunner.adaptavist.com/latest/jira/fragments/HideUIElement.html
Module key: com.atlassian.jira.system.issueoperations:attach-file …..
Copy Project UI
Section: browse_link/project_new
Condition: user should be a member of the Administrator group
Copy Project link (full
path): …../plugins/servlet/scriptrunner/builtin?section=builtin_scripts#com.onresolve.scriptrunner……CopyProject.groovy?
Copy Space UI
Section: TBD/space_new?
Condition: user should be a member of the Administrator group
Copy Space link Find the path by running the Built-in Script
CopySpace.groovy
Approve a Confluence page
Script Fragment: ApproveConfluencePage.groovy
REST Endpoint:
Files used in this workshop
78. ScriptRunner On Tour 2017
Slides and files will be made available soon
http://hub.adaptavist.com/SRoT17
Offer for Attendees only:
50% discount (1st year only)
New purchase for SR4BB, SR4C or SR4J
Please Evaluate first then contact
licensing@adaptavist.com
Where Can You Get this?
82. Adaptavist Atlassian Certification
Adaptavist was hired by Atlassian to help develop:
• Five (5) Atlassian Certified Professional Exams
• Create ACP Exam Preparation Study Materials now sold by Atlassian
• Create and Deliver Summit Training – San Jose and Barcelona
85. Afternoon Agenda – New York
Workshop Intro (Harp Athwal)
ScriptRunner Intro (Rizwan Hasan)
ScriptRunner - Using SR for Support Delivery (Jamie Echlin)
ScriptRunner for Confluence Demo (Mark McCormack)
> with outline for SR for JIRA and Bitbucket too
Extending the User Interface for JIRA (Jamie Echlin)
> Deep dive into customising the UI
Final ScriptRunner session Q&A
SIGN UP FOR THE SLIDES
86. Evening Agenda – New York
ScriptRunner Overview
Sneak Peak at SR’s new editor (Jamie Echlin)
ScriptRunner session Q&A