├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── ReadMe ├── credentials.PNG ├── message.PNG ├── screenshot.PNG ├── screenshot2.png ├── screenshot3.png ├── template_parameters.PNG └── template_parameters2.PNG ├── ServiceNow - Example v2.0.pbit └── ServiceNow - Example v3.0.pbit /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | /.vs 6 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at anthonyduguid@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via issue, 4 | email, or any other method with the owners of this repository before making a change. 5 | 6 | Please note we have a code of conduct, please follow it in all your interactions with the project. 7 | 8 | ## Pull Request Process 9 | 10 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a 11 | build. 12 | 2. Update the README.md with details of changes to the interface, this includes new environment 13 | variables, exposed ports, useful file locations and container parameters. 14 | 3. Increase the version numbers in any examples files and the README.md to the new version that this 15 | Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). 16 | 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you 17 | do not have permission to do that, you may request the second reviewer to merge it for you. 18 | 19 | ## Code of Conduct 20 | 21 | ### Our Pledge 22 | 23 | In the interest of fostering an open and welcoming environment, we as 24 | contributors and maintainers pledge to making participation in our project and 25 | our community a harassment-free experience for everyone, regardless of age, body 26 | size, disability, ethnicity, gender identity and expression, level of experience, 27 | nationality, personal appearance, race, religion, or sexual identity and 28 | orientation. 29 | 30 | ### Our Standards 31 | 32 | Examples of behavior that contributes to creating a positive environment 33 | include: 34 | 35 | * Using welcoming and inclusive language 36 | * Being respectful of differing viewpoints and experiences 37 | * Gracefully accepting constructive criticism 38 | * Focusing on what is best for the community 39 | * Showing empathy towards other community members 40 | 41 | Examples of unacceptable behavior by participants include: 42 | 43 | * The use of sexualized language or imagery and unwelcome sexual attention or 44 | advances 45 | * Trolling, insulting/derogatory comments, and personal or political attacks 46 | * Public or private harassment 47 | * Publishing others' private information, such as a physical or electronic 48 | address, without explicit permission 49 | * Other conduct which could reasonably be considered inappropriate in a 50 | professional setting 51 | 52 | ### Our Responsibilities 53 | 54 | Project maintainers are responsible for clarifying the standards of acceptable 55 | behavior and are expected to take appropriate and fair corrective action in 56 | response to any instances of unacceptable behavior. 57 | 58 | Project maintainers have the right and responsibility to remove, edit, or 59 | reject comments, commits, code, wiki edits, issues, and other contributions 60 | that are not aligned to this Code of Conduct, or to ban temporarily or 61 | permanently any contributor for other behaviors that they deem inappropriate, 62 | threatening, offensive, or harmful. 63 | 64 | ### Scope 65 | 66 | This Code of Conduct applies both within project spaces and in public spaces 67 | when an individual is representing the project or its community. Examples of 68 | representing a project or community include using an official project e-mail 69 | address, posting via an official social media account, or acting as an appointed 70 | representative at an online or offline event. Representation of a project may be 71 | further defined and clarified by project maintainers. 72 | 73 | ### Enforcement 74 | 75 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 76 | reported by contacting the project team at [INSERT EMAIL ADDRESS]. All 77 | complaints will be reviewed and investigated and will result in a response that 78 | is deemed necessary and appropriate to the circumstances. The project team is 79 | obligated to maintain confidentiality with regard to the reporter of an incident. 80 | Further details of specific enforcement policies may be posted separately. 81 | 82 | Project maintainers who do not follow or enforce the Code of Conduct in good 83 | faith may face temporary or permanent repercussions as determined by other 84 | members of the project's leadership. 85 | 86 | ### Attribution 87 | 88 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 89 | available at [http://contributor-covenant.org/version/1/4][version] 90 | 91 | [homepage]: http://contributor-covenant.org 92 | [version]: http://contributor-covenant.org/version/1/4/ 93 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Anthony Duguid 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Service Now Power BI Template 2 | 3 | This Power BI template is used for loading Service Now records from the task table using Rest API. I used [Alberto Colombo's blog post](https://blog.kofko.xyz/connect-servicenow-and-powerbi) as a reference to create this template. 4 | 5 |

6 | 7 |

8 | 9 | 10 | ## References: 11 | * https://developer.servicenow.com/dev.do#!/reference/api/orlando/rest/c_TableAPI 12 | * https://docs.servicenow.com/bundle/kingston-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html 13 | 14 | 15 | ## Dependencies 16 |
17 | 18 | |Software |Dependency | 19 | |:------------------------------------------|:--------------------------| 20 | |[Power BI Desktop](https://powerbi.microsoft.com/en-us/downloads/)|Template| 21 | |[Power BI Desktop](https://community.powerbi.com/t5/Themes-Gallery/University-of-Melbourne/td-p/163417)|Theme| 22 |
23 | 24 | ## Glossary of Terms 25 |
26 | 27 | | Term | Meaning | 28 | |:--------------------------|:-----------------------------------------------------------------------------------------| 29 | | Rest API |A REST API (also known as RESTful API) is an application programming interface (API or web API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services. REST stands for representational state transfer and was created by computer scientist Roy Fielding.| 30 | | Service Now |A ticketing tool that processes and catalogs customer service requests. You can raise requests that deal with incidents, changes, problems, and other services.| 31 | 32 |
33 | 34 | 35 | ## Functionality 36 | This message is because the template was created in [Power BI Desktop for Report Server](https://powerbi.microsoft.com/en-au/report-server/), but it can be used in either RS or Service. 37 |

38 | 39 |

40 | 41 | 42 | This template requires the user to enter parameters as per the following screen. 43 |

44 | 45 |

46 | 47 | * servicenow_url = https://YOUR_COMPANY_NAME.service-now.com/ 48 | * assignment_group = Only one assignment group e.g. "Service Desk" 49 | 50 | * closed_date_offset = Used to offset the closed date updated by the system so it better reflects when the status is updated to a completed/closed status. I find 3 works well. 51 | * domain_name = Used to return a list of users from Active Directory 52 | 53 |
54 | 55 | The first connection will require some credentials: you can use your local ServiceNow credentials or a service account 56 | 57 |

58 | 59 |

60 | 61 |
62 | 63 | ## Rest API call examples 64 | 65 | ### Number of months: 66 | 67 | ``` 68 | = Json.Document(Web.Contents(servicenow_url & "/api/now/table/task? 69 | sysparm_display_value=true 70 | &sysparm_query=sys_class_nameINsc_req_item,incident 71 | ^sys_created_onONLast%20" & number_of_months & "%20months 72 | %40javascript%3Ags.beginningOfLast" & number_of_months & "Months() 73 | %40javascript%3Ags.endOfLast" & number_of_months & "Months() 74 | &assignment_group=" & assignment_group & " 75 | &numberISNOTEMPTY 76 | &sysparm_exclude_reference_link=true 77 | &sysparm_fields=sys_id 78 | %2Cactive 79 | %2Capproval_set 80 | %2Cclosed_at 81 | %2Cdue_date 82 | %2Cnumber 83 | %2Copened_at 84 | %2Cshort_description 85 | %2Csla_due 86 | %2Csys_class_name 87 | %2Csys_created_on 88 | %2Csys_updated_on 89 | %2Cu_service_area 90 | %2Curgency 91 | %2Cassignment_group 92 | %2Cu_requestor 93 | %2Cassigned_to 94 | %2Cstate 95 | %2Cu_affected_user")) 96 | ``` 97 | 98 | ### Between 2 dates: 99 | 100 | ``` 101 | = Json.Document(Web.Contents(servicenow_url & "/api/now/table/task? 102 | sysparm_display_value=true 103 | &sysparm_query=sys_class_nameINsc_req_item,incident 104 | ^sys_created_onBETWEEN 105 | javascript:gs.dateGenerate('" & Date.ToText(start_date, "yyyy-MM-dd") & "','00:00:00')@ 106 | javascript:gs.dateGenerate('" & Date.ToText(end_date, "yyyy-MM-dd") & "','00:00:00') 107 | &assignment_group=" & assignment_group & " 108 | &numberISNOTEMPTY 109 | &sysparm_exclude_reference_link=true 110 | &sysparm_fields=sys_id 111 | %2Cactive 112 | %2Capproval_set 113 | %2Cclosed_at 114 | %2Cdue_date 115 | %2Cnumber 116 | %2Copened_at 117 | %2Cshort_description 118 | %2Csla_due 119 | %2Csys_class_name 120 | %2Csys_created_on 121 | %2Csys_updated_on 122 | %2Cu_service_area 123 | %2Curgency 124 | %2Cassignment_group 125 | %2Cu_requestor 126 | %2Cassigned_to 127 | %2Cstate 128 | %2Cu_affected_user")) 129 | ``` 130 | -------------------------------------------------------------------------------- /ReadMe/credentials.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerBi-Projects/ServiceNow/2cf17ee8dd8e110b3a96b190f0e128e02bb0b1bd/ReadMe/credentials.PNG -------------------------------------------------------------------------------- /ReadMe/message.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerBi-Projects/ServiceNow/2cf17ee8dd8e110b3a96b190f0e128e02bb0b1bd/ReadMe/message.PNG -------------------------------------------------------------------------------- /ReadMe/screenshot.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerBi-Projects/ServiceNow/2cf17ee8dd8e110b3a96b190f0e128e02bb0b1bd/ReadMe/screenshot.PNG -------------------------------------------------------------------------------- /ReadMe/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerBi-Projects/ServiceNow/2cf17ee8dd8e110b3a96b190f0e128e02bb0b1bd/ReadMe/screenshot2.png -------------------------------------------------------------------------------- /ReadMe/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerBi-Projects/ServiceNow/2cf17ee8dd8e110b3a96b190f0e128e02bb0b1bd/ReadMe/screenshot3.png -------------------------------------------------------------------------------- /ReadMe/template_parameters.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerBi-Projects/ServiceNow/2cf17ee8dd8e110b3a96b190f0e128e02bb0b1bd/ReadMe/template_parameters.PNG -------------------------------------------------------------------------------- /ReadMe/template_parameters2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerBi-Projects/ServiceNow/2cf17ee8dd8e110b3a96b190f0e128e02bb0b1bd/ReadMe/template_parameters2.PNG -------------------------------------------------------------------------------- /ServiceNow - Example v2.0.pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerBi-Projects/ServiceNow/2cf17ee8dd8e110b3a96b190f0e128e02bb0b1bd/ServiceNow - Example v2.0.pbit -------------------------------------------------------------------------------- /ServiceNow - Example v3.0.pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PowerBi-Projects/ServiceNow/2cf17ee8dd8e110b3a96b190f0e128e02bb0b1bd/ServiceNow - Example v3.0.pbit --------------------------------------------------------------------------------