Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA validator based upon development tools

Hi all,

Is there anything in groovy scripting or other ways to create a validator (or condition) based upon whether or not there is the development tools link?

I know through triggers I can transition issues based upon an event from fisheye.

What I am looking to do is if there is any commits tied to an issue block it from being closed by any other resolution than fixed.   So  < there is a code commit tied to the project > &&  cfValues['Dev Resolution'].toString() != 'Fixed'  then kick off the validator. 

Thanks,

Robert

 

2 answers

Thanks for the answer, but I can check the resolution value no problem (I have that exact code above cfValues['Dev Resolution'].toString() != 'Fixed' ) .   The problem is I need to check if there are any code commits.

And yes we have script runner.   

i know in JQL the below works - try you can make use of the same

 

issue.property[development].commits > 0

With that code I keep getting:

groovy.lang.MissingPropertyException: No such property: property for class: com.atlassian.jira.issue.IssueImpl

@Robert G. Nadon

I have got same requirement, did you get the answer? or any workaround?

Was looking for an similar requirement - having open pull requests.
I Have not found anything on how to access the Development tools in Scriptrunner, but 
I ended up executing JQL from within the Scriptrunner Script. 

With this you can filter on the following depending on which software you use:

  • development[commits].all
  • development[pullrequests].all
  • development[pullrequests].open
  • development[reviews].all
  • development[reviews].open
  • development[builds].failing
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter

def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchProvider = ComponentAccessor.getComponent(SearchProvider)

// edit this query to suit#
def query = jqlQueryParser.parseQuery("issuekey = " + issue.key + " AND development[commits].all > 0")
def results = searchProvider.search(query, currentUser, PagerFilter.getUnlimitedFilter())
return results.total == 1

@Robert G. Nadon @Tejas Naik

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

3,998 views 11 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you