Issue 2814: Its-Jira plugin not updating the jira issue
Status:  AwaitingInformation
Owner: ----
Reported by prave...@gmail.com, Aug 4, 2014
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version:

What steps will reproduce the problem?
1.Compiled and Installed its-jira on gerrit 2.9 STABLE
2.
3.

What is the expected output? What do you see instead?
"Its-Jira" plugin should update Jira issue with comments as per configuration in gerrit.config file . 
Below is my "its-Jira" configuration in gerrit.config file :

[commentLink "its-jira"]
        match = ([A-Z]+-[0-9]+)
        html = <a href=\"https://jira.inside.nsn.com/browse/$1\">$1</a>
        association = MANDATORY
[plugin "its-jira"]
        enabled = true
[its-jira]
  commentOnChangeAbandoned = true
  commentOnChangeCreated = true
  commentOnChangeMerged = true
  commentOnChangeRestored = false
  commentOnCommentAdded = true
  commentOnFirstLinkedPatchSetCreated = false
  commentOnPatchSetCreated = false
  commentOnRefUpdatedGitWeb = false

And also , issue id is getting validated before pushing and push is rejected if there is no Jira id in the commit message . Only Jira id is not getting updated as per configuration in gerrit.config file .


Please provide any additional information below.
I am getting below error in error_log
[2014-08-04 14:39:56,309] WARN  com.googlesource.gerrit.plugins.hooks.workflow.RuleBase : ITS actions configuration file (/opt/gerrit2/git_repo/etc/its/action.config) does not exist

Aug 12, 2014
#1 Bartosz....@googlemail.com
Any update regarding this issue.
I faced the same problem in my environment.
Aug 13, 2014
#2 prave...@gmail.com
No updates yet
Aug 21, 2014
#3 jotd...@gmail.com
@Praveen,

it seems that your configuration is incomplete because the data to connect to your JIRA server is missing.

In etc/gerrit.config:
[its-jira]
  url = https://jira.inside.nsn.com
  username = <login name of a valid JIRA user>
  commentOnChangeAbandoned = true
  ...

And in etc/security.config:
[its-jira]
  password = <password of the JIRA user>

You will asked for this data if you run a Gerrit init after installation of the plugins.

"etc/its/action.config" is used to configure the ITS plugins. A description is in the directory where you compiled your plugins:

its-base/its-base/src/main/resources/Documentation/config.md

its-jira/src/main/resources/Documentation/config.md
Sep 1, 2014
Project Member #4 david.pu...@sonymobile.com
Praveen, did you get this to work?
Status: AwaitingInformation
Sep 3, 2014
#5 prave...@gmail.com
Hi David ,

No , its not working .
Below are my configuration files

gerrit.config
[its-jira]
        url = https://jira.inside.nsn.com
        username = fekat
[commentLink "its-jira"]
        match = ([A-Z]+-[0-9]+)
        html = <a href=\"https://jira.inside.nsn.com/browse/$1\">$1</a>
        association = MANDATORY
secure.config

[its-jira]
        password = nsndc

Am i still missing anything here ?

Thanks in advance


Sep 3, 2014
Project Member #6 david.pu...@sonymobile.com
There is another bug in the plugin that might be related.  See  issue 2865 .

I've uploaded a fix for that one.

https://gerrit-review.googlesource.com/#/c/59714/
Sep 4, 2014
#7 jotd...@gmail.com
Praveen,

just a stupid question:
Have you compiled and installed the plugin "its-base", too?

I am pretty sure that "its-base" is needed by "its-jira". 

Quote from the "its-base" documentation:
"its-base is by itself not a real plugin, but the common parent project for issue tracking system (ITS) plugins for Gerrit, such as its-bugzilla, its-jira or its-rtc."
Sep 4, 2014
#8 prave...@gmail.com
Yes , i have installed its-base as its an prerequisite for its-jira


Sep 5, 2014
#9 jotd...@gmail.com
Hi Praveen,

my configuration in etc/gerrit.config and etc/secure.config is similar.

Additionally, I have the files "etc/issue-state-transition.config" and "etc/its/action.config" which have the following contents:

etc/issue-state-transition.config:
[action "Start Progress"]
	change=created

[action "Start Review"]
	change=created

[action "Resolve Issue"]
	change=merged


etc/its/action.config:
[rule "patch-set"]
        event-type = patchset-created
	status = !, DRAFT
        action = add-comment A new patchset was added to che Gerrit change
	action = log-event
[rule "merged"]
        event-type = change-merged
        action = add-standard-comment
	action = log-event
[rule "verified_no"]
        event-type = comment-added
        approval-Verified = -1
        action = add-comment Verification by Jenkins failed
	action = log-event
[rule "verified_yes"]
        event-type = comment-added
        approval-Verified = +1
        action = add-comment Verification by Jenkins was successful
...

In my case, Gerrit is updating the related JIRA ticket with comments about new patch sets, Code Review and Verification results, merged changes etc. 
May 26, 2015
#10 khanna7r...@gmail.com
we are getting anonymous user in JIRA log after having this configurations.
Any idea on this!!
May 26, 2015
#11 jotd...@gmail.com
Did you configure in Gerrit a valid JIRA user?
It is done in the two files $SITE_PATH/etc/gerrit.config and $SITE_PATH/etc/security.config.

In $SITE_PATH/etc/gerrit.config:
[its-jira]
  url = https://jira.inside.nsn.com
  username = <login name of a valid JIRA user>
  ...

And in $SITE_PATH/etc/security.config:
[its-jira]
  password = <password of the JIRA user>

You might want to check manually whether it is possible to login to JIRA with this user.