Search in JQL
The custom JQL function allows the users to search through Jira work items and view HubSpot attributes, without switching between the tools. With relevant details available at hand, they can make well-informed decisions and avoid potential risks.
The custom JQL function can be used for two field types - HubSpot custom fields and User-type fields, such as Reporter, Assignee, etc. Below, an explanation is provided regarding the function syntax for both field types.
Danger
Remember that the use of JQL operators in syntax must be compliant with JQL documentation.
For example:
When using the operator IS, remember that it can only be used with EMPTY or NULL.
Knowing that, following examples of queries will work fine:
issue in hubspotProperty("cf[24528].country is null")
issue in hubspotProperty("cf[24528].country is empty")
However, the query below won’t work:
hubspotProperty("HubSpot Contact[24528].country is Poland")
HubSpot custom fields
Custom JQL function syntax
field operator hubspotProperty(searchJQL)- field - a field that is operated by the function
- here, only Issue fields are supported
- operator - one of the supported JQL operators
- available operators:
in,not in
- available operators:
- hubspotProperty - name of the custom function dedicated strictly to HubSpot custom fields
- searchJQL - query in a format supported by the custom JQL
searchJQL syntax
"fieldName.propertyName operator propertyValue"- fieldName - HubSpot custom field name in Jira
- Available formats of entry:
- Numbers are the fieldID
HubSpot Contacts[24833]HubSpot Contacts_24833HubSpot Contacts
- Numbers are the fieldID
- Available formats of entry:
- propertyName - attribute’s name for a specific HubSpot object
- Examples: .
email,domain,country,firstNameetc.
- Examples: .
- operator - operator in JQl format, used for HubSpot search
- Available operators:
=,!=,>=,<=,>,<,in,not in,~,!~,is not,is
- Available operators:
- propertyValue - the value of an attribute for a HubSpot object, such as
Mark,Germanyetc.
Caution
For operators ~ , !~ propertyValue supports wildcards, for example @slothindustries.com
Examples
Work item in hubspotProperty("HubSpot Contacts[24833].email ~ *@slothindustries.com")The search will return all of Jira work items, where the HubSpot Contacts custom field lists users with defined in the query e-mail.
Work item not in hubspotProperty("HubSpot Contacts.country = Germany")The search will return all of the Jira work items, where contacts listed in the HubSpot custom field are not from Germany.
User-type fields
Custom JQL function syntax
field operator hubspotWithProperty(searchJQL)- field - a field that is operated by the function
- Here, the only field type supported is User, e.g.
Reporter,Voter,Assigneeetc.
- Here, the only field type supported is User, e.g.
- operator - one of the supported JQL operators
- Available operators:
in,not in,is,is not,=,!=
- Available operators:
- hubspotWithProperty - the name of the function that is dedicated for User-type fields
- searchJQL - query in a dedicated format for the custom JQL
searchJQL syntax
"objectType.propertyName operator propertyValue"- objectType - the name of a HubSpot object
- Available objects:
contacts
- Available objects:
- propertyName - the name of the object’s attribute in HubSpot, e.g.
email,domain,country,firstNameetc. - operator - operator in the JQL format used for HubSpot search
- Available operators:
=,!=,>=,<=,>,<,in,not in,~,!~,is not,is
- Available operators:
- propertyValue - the value for the HubSpot object’s attribute, e.g.
Kathrine,Irelandetc.
Caution
For operators ~ , !~ propertyValue supports wildcards, for example @slothindustries.com
Examples
Reporter = hubspotWithProperty("contacts.email ~ *@greenbook.com")The search will return HubSpot contacts, which are listed as Reporters and their e-mails belong to the same, defined domain.
Watcher = hubspotWithProperty("contacts.country !~ Ireland")The search will return HubSpot contacts, which are defined as Watchers and they do not contain the information that they are from Ireland.
Troubleshooting guide
Any changes in HubSpot data should update automatically every hour. However, if the changes are still not visible in Jira, users can enforce the refresh by clicking Refresh data. After reload, the details should be up-to-date.