Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I search Jira/JQL for code snippets?

Ryan Hagan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 14, 2022

Is there a way I can search Jira for code snippets? I'm collecting snippets that can serve as samples.

I'm using this JQL query - is there a way to target code? Or search for braces/brackets?

project IN ('Inbox') AND (text ~ "sample" AND text ~ "example" OR text ~ "code" OR text ~ "snippet") AND created >= startOfYear(-1) and created <= endOfYear()

 

2 answers

0 votes
Aron Gombas _Midori_
Community Champion
February 15, 2022

You cannot search code with JQL.

JQL can only return issues, nothing else.

If you store your code in Bitbucket Cloud, you can use its own search feature for that purpose.

0 votes
Trudy Claspill
Community Champion
February 14, 2022

Hello @Ryan Hagan 

Welcome to the community.

There are a few open issues with native text searching in Jira Cloud that will impact your ability to find a solution. Refer to

https://jira.atlassian.com/browse/JRACLOUD-75866 - problem searching for special characters

https://jira.atlassian.com/browse/JRACLOUD-21372 - problem searching for exact phrase

https://jira.atlassian.com/browse/JRACLOUD-69263 - problem searching for exact text

 

You'll also want to refer to these documents:

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-operators/#Advancedsearchingoperatorsreference-CONTAINS-CONTAINS--

https://support.atlassian.com/jira-software-cloud/docs/search-syntax-for-text-fields/

Suggest an answer

Log in or Sign up to answer