Jira issue key mandatory

engg July 14, 2013

Hi,

When we do a TFS check-in, is it possible to make a JIRA issue key mandatory in the check-in comment?

The goal is to not allow a TFS check-in if the JIRA issue key is missing in the check-in comment.

Thank you.

- Saurabh

6 answers

1 accepted

0 votes
Answer accepted
Andrzej Pasterczyk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2013

Hi,

If you use our check-in policy then it is mandatory to associate check-in with JIRA. However by design TFS allows to override policy warning (in fact allowing to bypass it) but you can set up e-mail notification on such events (see here for example http://www.woodwardweb.com/vsts/policy_override.html )

engg July 17, 2013

When we do a TFS check-in, UseTFS shows JIRA issues to choose from, right, to associate one with the current check-in? Does it show all the JIRA issues or only the ones assigned to the person checking in (preferable)? Does UseTFS use any other filters like the status of JIRA issues e.g. showing only the ones that are not closed?

Thanks.

Andrzej Pasterczyk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 18, 2013

UseTFS allows users to either access their filters that are saved in JIRA or directly write JQL query (unfortunatelly without those nice suggestions that you get using JIRA web interface).

Also you can filter and sort the results.

engg July 31, 2013

Thank you Andrzej. When we add Jira issue key (e.g. JIRA-1234) to either check-in comment or check-in notes, does 'UseTFS Jira plugin' check if that JIRA issue key exists i.e. JIRA-1234 is a valid JIRA issue and not a random string?

If it doesn't, then does 'UseTFS check-in policy' component enforce that?

In UseTFS - check-in policy video, the user checks one of the four checkboxes to associate a JIRA issue with the code change. What happens if we don’t check any?

Thanks.

1 vote
Alex Perez
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2013

Hi engg,

In Subversion you can add some scripts that are executed every time a user uploads some code (commit), called hooks. In these hooks you can enforce that the user fills the comment, references a JIRA issue, all methods are documented, whatever ... or the hook raises an error that prevents the commit.

But this is more related to the subversion management (TFS in your case) than jira nor subversion plugin. As far I understand, this is out of the useTFS plugin scope (preventing checkin), but in the TFS. Does TFS have some way to call a script or external program to allow or disallow a code check-in?

if yes, you can write a simple java program that access Jira and checks if all keys mentioned in the comment exists as issue Key.

Edit: Ive deleted this answer few minutes after posting, because just noticed that TFS has something called 'checkin policies' and really I dont know anything about TFS except by comparing with SVN, so I thought that this answer wasn't really helpful.

HTH

0 votes
engg July 17, 2013

Andrzej,

When we do a TFS check-in, UseTFS shows JIRA issues to choose from, right, to associate one with the current check-in? Does it show all the JIRA issues or only the ones assigned to the person checking in (preferable)? Does UseTFS use any other filters like the status of JIRA issues e.g. showing only the ones that are not closed?

Thanks.

0 votes
engg July 14, 2013

Thank you, Andrzej. I will look into it.

Also, Alex Perez's comment is not visible here. Alex, your answer is helpful too. I will explore wriiting a hook in TFS to achieve this.

The other goal is to view TFS check-ins from Jira web UI. Is this possible without using a plug-in like UseTFS or TFS4JIRA?

Thanks.

I wanted to leave the question open, but in an attempt to see Alex Perez's comment here, somehow Andrzej's answer got accepted.

0 votes
Alex Perez
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2013

Hi engg,

In Subversion you can add some scripts that are executed every time a user uploads some code (commit), called hooks. In these hooks you can enforce that the user fills the comment, references a JIRA issue, all methods are documented, whatever ... or the hook raises an error that prevents the commit.

But this is more related to the subversion management (TFS in your case) than jira nor subversion plugin. As far I understand, this is out of the useTFS plugin scope (preventing checkin), but in the TFS. Does TFS have some way to call a script or external program to allow or disallow a code check-in?

if yes, you can write a simple java program that access Jira and checks if all keys mentioned in the comment exists as issue Key.

HTH

0 votes
engg July 14, 2013

I meant in useTFS.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events