SlideShare a Scribd company logo
1 of 86
Download to read offline
SCRIPTRUNNER: TIPS, TRICKS AND TAKEAWAYS
Riz Hasan
April 27, 2017
What is ScriptRunner?
Question
Can you do that in JIRA?
Do I need to be a Developer
to use ScriptRunner?
Expectation
Scripting
Knowledge
What you can do with ScriptRunner
Reality
Scripting
Knowledge
What you can do with ScriptRunner
My Story with ScriptRunner
User Story:
Copying a complete template project
User Story: Copying a complete template project
User Story:
Project Risk Register using Scripted Fields
1212
User Story: Project Risk Register using Scripted Fields
1313
User Story: Project Risk Register using Scripted Fields
1414
User Story: Project Risk Register using Scripted Fields
1515
User Story: Project Risk Register using Scripted Fields
1616
User Story: Project Risk Register using Scripted Fields
Reality
Scripting
Knowledge
What you can do with ScriptRunner
Reality
ScriptRunner
Knowledge
What you can do with ScriptRunner
Scripting
Knowledge
Reality
Scripting
Knowledge
What you can do with ScriptRunner
Question
Can you do that in JIRA?
Answer
You could use ScriptRunner for that!
SCRIPTRUNNER: TIPS, TRICKS AND
TAKEAWAYS
Riz Hasan
April 27, 2017
SCRIPTRUNNER: OVERVIEW
Eric Lemay
April 25th, 2017
Eric Lemay
Atlassian Consultant
What is ScriptRunner?
Question
Can you do (insert wild use case here) in JIRA?
80%	of	the	time,	the	functionality	is	out	of	the	box
Plus	another	15%	comes	from	add-ons
Question
Can you do that in JIRA?
Answer
No
(Sort Of)
Question
Can you do that in JIRA?
Answer
You could use ScriptRunner for that!
User Story:
Storing contract hours for a project
User Story: Storing contract hours for a project
User Story: Storing contract hours for a project
User Story: Storing contract hours for a project
User Story: Storing contract hours for a project
User Story: Storing contract hours for a project
User Story: Storing contract hours for a project
User Story: Storing contract hours for a project
User Story:
Travel Planning
User Story: Travel Planning
User Story: Travel Planning
User Story: Travel Planning
Question
Can you do that in JIRA?
Answer
You could use ScriptRunner for that!
SCRIPTRUNNER: OVERVIEW
Eric Lemay
April 25th, 2017
Script Walkthrough
Workshop Examples
Mark McCormack, Commercial Manager, Adaptavist Products
Which JIRA?
Basics
UI changes for JIRA & Confluence
Escalation Service
Event Handlers for Confluence and JIRA
Two Simple (but useful) Behaviours
Outline
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
UI Change in JIRA
Hiding	UI	Elements	- <SR	documentation	link>
UI Changes (… Continued)
SR Doc’n link: https://scriptrunner.adaptavist.com
Add “Copy Project” Built-in Script
UI Changes – Add an existing built-in script
Add Copy Space to Confluence
Script Fragment - Copy Space
Add “Script Registry” Built-in Script
Approval Workflows
Demo tonight – AUG
Escalation Service
Event Handler – Confluence Space & JIRA Project
Event Handler – Page inline content checker
Approve a Confluence Page
Two Simple Behaviour Examples
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
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	…
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?
ScriptRunner
Mark McCormack, Commercial Manager, Adaptavist Products
ScriptRunner for Confluence
- Live Demo
ScriptRunner for Bitbucket
Presentation Outline
Maintaining Confluence
Confluence Grows
Confluence	adoption	grows
• More	and	more	content
• Hundreds	of	spaces
• Thousands	of	pages	&	
versions
• Even	more	comments
• Inconsistencies	start	
appearing
Maintaining Confluence
Regular Maintenance
• Form a “Wiki Gardening” Group
• Regularly sweep all your spaces
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?
ScriptRunner for Confluence
Let ScriptRunner for Confluence help you!
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
ScriptRunner for Bitbucket
Pull Requests - Auto Add a mandatory approver
ScriptRunner for Bitbucket
Pre Receive Hooks – Block “git pushes” of large binaries
ScriptRunner for Bitbucket
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	…
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
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?
Thank You
Mark McCormack, Commercial Manager, Adaptavist Products
HARP ATHWAL • HEAD OF NORTH AMERICA CONSULTANCY
• ADAPTAVIST • @ADAPTAVIST
Adaptavist ScriptRunner
New York, Toronto, and Montreal AUG Roadshow
Adaptavist? Harp?
New York
Chicago
Hartford
Charlotte
Seattle
San Diego
Springfield
Dallas
Denver
Montreal
Toronto
Ottawa
London, UK
Leamington Spa
Amsterdam
Germany
Prague
???
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
Harp and Entourage
The Adaptavist Team
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
Evening Agenda – New York
ScriptRunner Overview
Sneak Peak at SR’s new editor (Jamie Echlin)
ScriptRunner session Q&A

More Related Content

What's hot

DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code DeploysDevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
Andreas Grabner
 

What's hot (20)

Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
Performance Metrics Driven CI/CD - Introduction to Continuous Innovation and ...
 
An Exploration of Cross-product App Experiences
An Exploration of Cross-product App ExperiencesAn Exploration of Cross-product App Experiences
An Exploration of Cross-product App Experiences
 
Modern Operations at Scale within Viasat – How to Structure Teams and Build A...
Modern Operations at Scale within Viasat – How to Structure Teams and Build A...Modern Operations at Scale within Viasat – How to Structure Teams and Build A...
Modern Operations at Scale within Viasat – How to Structure Teams and Build A...
 
Developers Use Bitbucket and So Can You
Developers Use Bitbucket and So Can YouDevelopers Use Bitbucket and So Can You
Developers Use Bitbucket and So Can You
 
Advocating Adoption: Best Practices for User-Friendly Jira Configurations
Advocating Adoption: Best Practices for User-Friendly Jira ConfigurationsAdvocating Adoption: Best Practices for User-Friendly Jira Configurations
Advocating Adoption: Best Practices for User-Friendly Jira Configurations
 
Big Bang And Beyond: Migrating Between Server and Cloud
Big Bang And Beyond: Migrating Between Server and CloudBig Bang And Beyond: Migrating Between Server and Cloud
Big Bang And Beyond: Migrating Between Server and Cloud
 
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code DeploysDevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
 
Demystifying Web Performance
Demystifying Web PerformanceDemystifying Web Performance
Demystifying Web Performance
 
Accelerating Add-on Development From Concept to Launch
Accelerating Add-on Development From Concept to LaunchAccelerating Add-on Development From Concept to Launch
Accelerating Add-on Development From Concept to Launch
 
The Four Principles of Atlassian Performance Tuning
The Four Principles of Atlassian Performance TuningThe Four Principles of Atlassian Performance Tuning
The Four Principles of Atlassian Performance Tuning
 
Saving Money by Optimizing Your Cloud Add-On Infrastructure
Saving Money by Optimizing Your Cloud Add-On InfrastructureSaving Money by Optimizing Your Cloud Add-On Infrastructure
Saving Money by Optimizing Your Cloud Add-On Infrastructure
 
Integration Testing on Steroids: Run Your Tests on the Real Things
Integration Testing on Steroids: Run Your Tests on the Real ThingsIntegration Testing on Steroids: Run Your Tests on the Real Things
Integration Testing on Steroids: Run Your Tests on the Real Things
 
DevOps: Cultural and Tooling Tips Around the World
DevOps: Cultural and Tooling Tips Around the WorldDevOps: Cultural and Tooling Tips Around the World
DevOps: Cultural and Tooling Tips Around the World
 
5 Essential Techniques for Building Fault-tolerant Systems
5 Essential Techniques for Building Fault-tolerant Systems5 Essential Techniques for Building Fault-tolerant Systems
5 Essential Techniques for Building Fault-tolerant Systems
 
Four Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance ProblemsFour Practices to Fix Your Top .NET Performance Problems
Four Practices to Fix Your Top .NET Performance Problems
 
What's New in Jira Cloud for Developers
What's New in Jira Cloud for DevelopersWhat's New in Jira Cloud for Developers
What's New in Jira Cloud for Developers
 
Scaling Without Expanding: a DevOps Story
Scaling Without Expanding: a DevOps StoryScaling Without Expanding: a DevOps Story
Scaling Without Expanding: a DevOps Story
 
The New & Improved Confluence Server and Data Center
The New & Improved Confluence Server and Data CenterThe New & Improved Confluence Server and Data Center
The New & Improved Confluence Server and Data Center
 
Continuous Delivery in the Cloud with Bitbucket Pipelines
Continuous Delivery in the Cloud with Bitbucket PipelinesContinuous Delivery in the Cloud with Bitbucket Pipelines
Continuous Delivery in the Cloud with Bitbucket Pipelines
 
Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!
 

Similar to Atlassian User Group NYC April 27 2017 ScriptRunner Workshop

Similar to Atlassian User Group NYC April 27 2017 ScriptRunner Workshop (20)

SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem.
SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem. SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem.
SharePoint Framework -The future of SharePoint/ Office 365 developer ecosystem.
 
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hourConvert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
Convert your Full Trust Solutions to the SharePoint Framework (SPFx) in 1 hour
 
ATAGTR2017 Protractor Cucumber BDD Approach
ATAGTR2017 Protractor Cucumber BDD ApproachATAGTR2017 Protractor Cucumber BDD Approach
ATAGTR2017 Protractor Cucumber BDD Approach
 
Front End performance as a Continuous Integration - Part1
Front End performance as a Continuous Integration - Part1Front End performance as a Continuous Integration - Part1
Front End performance as a Continuous Integration - Part1
 
JavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthJavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In Depth
 
Web Development Foundation & Team Collaboration
Web Development Foundation & Team CollaborationWeb Development Foundation & Team Collaboration
Web Development Foundation & Team Collaboration
 
Exploring My Career: an Exclusive Interview EN
Exploring My Career: an Exclusive Interview ENExploring My Career: an Exclusive Interview EN
Exploring My Career: an Exclusive Interview EN
 
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
Getting started with spfx
Getting started with spfxGetting started with spfx
Getting started with spfx
 
Rahul kaduskar
Rahul kaduskarRahul kaduskar
Rahul kaduskar
 
Kunal bhatia resume mass
Kunal bhatia   resume massKunal bhatia   resume mass
Kunal bhatia resume mass
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
 
Hypermedia APIs from Event-Driven CQRS Systems
Hypermedia APIs from Event-Driven CQRS SystemsHypermedia APIs from Event-Driven CQRS Systems
Hypermedia APIs from Event-Driven CQRS Systems
 
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendJSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontend
 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFx
 
REST Development made Easy with ColdFusion Aether
REST Development made Easy with ColdFusion AetherREST Development made Easy with ColdFusion Aether
REST Development made Easy with ColdFusion Aether
 
Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!Modern Release Engineering in a Nutshell - Why Researchers should Care!
Modern Release Engineering in a Nutshell - Why Researchers should Care!
 
Essential Tools for Modern PHP
Essential Tools for Modern PHPEssential Tools for Modern PHP
Essential Tools for Modern PHP
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
 

More from Marlon Palha

More from Marlon Palha (10)

Slack integrations for Jira and Confluence
Slack integrations for Jira and ConfluenceSlack integrations for Jira and Confluence
Slack integrations for Jira and Confluence
 
Atlassian User Group NYC 101718 Event
Atlassian User Group NYC 101718 EventAtlassian User Group NYC 101718 Event
Atlassian User Group NYC 101718 Event
 
Atlassian User Group NYC 092718 Event
Atlassian User Group NYC 092718 EventAtlassian User Group NYC 092718 Event
Atlassian User Group NYC 092718 Event
 
Atlassian User Group NYC 080818 event
Atlassian User Group NYC 080818 eventAtlassian User Group NYC 080818 event
Atlassian User Group NYC 080818 event
 
NYC Atlassian User Group Overview
NYC Atlassian User Group OverviewNYC Atlassian User Group Overview
NYC Atlassian User Group Overview
 
Jira - Solving Reporting Problems using eazyBI
Jira - Solving Reporting Problems using eazyBIJira - Solving Reporting Problems using eazyBI
Jira - Solving Reporting Problems using eazyBI
 
Atlassian Tools and Platform Strategy
Atlassian Tools and Platform StrategyAtlassian Tools and Platform Strategy
Atlassian Tools and Platform Strategy
 
Atlassian User Group NYC 20170830 PreSummit Event Slides
Atlassian User Group NYC 20170830 PreSummit Event SlidesAtlassian User Group NYC 20170830 PreSummit Event Slides
Atlassian User Group NYC 20170830 PreSummit Event Slides
 
Atlassian User Group NYC 20171011 Post Summit Slides
Atlassian User Group NYC 20171011 Post Summit SlidesAtlassian User Group NYC 20171011 Post Summit Slides
Atlassian User Group NYC 20171011 Post Summit Slides
 
ITHAKA | JSTOR Business Systems - What we do
ITHAKA | JSTOR Business Systems - What we doITHAKA | JSTOR Business Systems - What we do
ITHAKA | JSTOR Business Systems - What we do
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Atlassian User Group NYC April 27 2017 ScriptRunner Workshop

  • 1. SCRIPTRUNNER: TIPS, TRICKS AND TAKEAWAYS Riz Hasan April 27, 2017
  • 3. Question Can you do that in JIRA?
  • 4.
  • 5. Do I need to be a Developer to use ScriptRunner?
  • 8. My Story with ScriptRunner
  • 9. User Story: Copying a complete template project
  • 10. User Story: Copying a complete template project
  • 11. User Story: Project Risk Register using Scripted Fields
  • 12. 1212 User Story: Project Risk Register using Scripted Fields
  • 13. 1313 User Story: Project Risk Register using Scripted Fields
  • 14. 1414 User Story: Project Risk Register using Scripted Fields
  • 15. 1515 User Story: Project Risk Register using Scripted Fields
  • 16. 1616 User Story: Project Risk Register using Scripted Fields
  • 18. Reality ScriptRunner Knowledge What you can do with ScriptRunner Scripting Knowledge
  • 20. Question Can you do that in JIRA? Answer You could use ScriptRunner for that!
  • 21. SCRIPTRUNNER: TIPS, TRICKS AND TAKEAWAYS Riz Hasan April 27, 2017
  • 25. Question Can you do (insert wild use case here) in JIRA? 80% of the time, the functionality is out of the box Plus another 15% comes from add-ons
  • 26. Question Can you do that in JIRA? Answer No (Sort Of)
  • 27. Question Can you do that in JIRA? Answer You could use ScriptRunner for that!
  • 28. User Story: Storing contract hours for a project
  • 29. User Story: Storing contract hours for a project
  • 30. User Story: Storing contract hours for a project
  • 31. User Story: Storing contract hours for a project
  • 32. User Story: Storing contract hours for a project
  • 33. User Story: Storing contract hours for a project
  • 34. User Story: Storing contract hours for a project
  • 35. User Story: Storing contract hours for a project
  • 37. User Story: Travel Planning
  • 38. User Story: Travel Planning
  • 39. User Story: Travel Planning
  • 40. Question Can you do that in JIRA? Answer You could use ScriptRunner for that!
  • 42. Script Walkthrough Workshop Examples Mark McCormack, Commercial Manager, Adaptavist Products
  • 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
  • 48. Add “Copy Project” Built-in Script
  • 49. UI Changes – Add an existing built-in script
  • 50. Add Copy Space to Confluence
  • 51. Script Fragment - Copy Space
  • 52. Add “Script Registry” Built-in Script
  • 55. Event Handler – Confluence Space & JIRA Project
  • 56. Event Handler – Page inline content checker
  • 59.
  • 60.
  • 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?
  • 64. ScriptRunner Mark McCormack, Commercial Manager, Adaptavist Products
  • 65. ScriptRunner for Confluence - Live Demo ScriptRunner for Bitbucket Presentation Outline
  • 67. Confluence Grows Confluence adoption grows • More and more content • Hundreds of spaces • Thousands of pages & versions • Even more comments • Inconsistencies start appearing
  • 69. Regular Maintenance • Form a “Wiki Gardening” Group • Regularly sweep all your spaces
  • 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?
  • 71. ScriptRunner for Confluence Let ScriptRunner for Confluence help you!
  • 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
  • 73. ScriptRunner for Bitbucket Pull Requests - Auto Add a mandatory approver
  • 74. ScriptRunner for Bitbucket Pre Receive Hooks – Block “git pushes” of large binaries
  • 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?
  • 79. Thank You Mark McCormack, Commercial Manager, Adaptavist Products
  • 80. HARP ATHWAL • HEAD OF NORTH AMERICA CONSULTANCY • ADAPTAVIST • @ADAPTAVIST Adaptavist ScriptRunner New York, Toronto, and Montreal AUG Roadshow
  • 81. Adaptavist? Harp? New York Chicago Hartford Charlotte Seattle San Diego Springfield Dallas Denver Montreal Toronto Ottawa London, UK Leamington Spa Amsterdam Germany Prague ???
  • 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