I need to paas the buildKey as a query parameter to the link defined in the web-item in atlassian-plugin.xml. currently I am passing the planKey, however it fails to load the Results saying the Plan XYZ not found. When I manually alter the URL, the report is rendered.
<link linkId="XYZ">/build/result/ViewBuildReport.action?planKey=${planKey}&buildNumber=${buildNumber}</link>
here the plan key that is generated is PROJ1-PLAN1 ,the report however fails to laod, saying PROJ1-PLAN1 not found. When I manually change the URL to PROJ1-PLAN1-JOB1 , the reports are rendered. This problem is occuring in Bamboo 5.9.7 version and not on latest.
In order to get the URL in the form PROJ1-PLAN1-JOB1 , I need to get the right bamboo variable, buildKey can get the value, but it is returning empty null string. I tried using buildKey=${buildKey} or buildKey=${bamboo.buildKey}, nothing works.So how to get this to work? I am not able to process the artifacts directory also due to this issue.
@Nikita Bedmutha I've same error did you find any solution?
btw i'm trying to put a link for a report in atlassian-pom.xml
If you select a job name in left menu which is
section="results.subMenu/results" -> buildKey = ABP-PLAN-JOB1-3
But in opening screen of a build, if you don't select anything then
section="chainResults.subMenu/chainResults" -> buildKey = ABP-PLAN
This should work conceptually, are you correctly passing the variable to the builder? This is a required step that's easy to forget, see Passing Bamboo variables to a build script:
Bamboo global and build specific variables can be referred to in build scripts or maven pom.xml. Bamboo variables are not directly available in the builder execution context however. They can be passed as parameters to the builder. [emphasis mine]
So for e.g. Maven you'd need something like this to reference the Bamboo variable ${bamboo.buildNumber} as a Maven property ${bambooBuildNumber} within a file processed by the build (more details):
clean package -DbambooBuildNumber=${bamboo.buildNumber}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Steffen, but yes, I am using it correctly as ${buildKey} in my bamboo plugin's atlassian-plugin.xml. This gives value as PROJ1-PLAN1, but what I expect for my report is PROJ1-PLAN1-JOB1, the full buildKey and not planKey. But it gives PROJ1-PLAN1 only for buildKey also. As a result, Bamboo throws error 'An unexpected error occured', PROJ1-PLAN1 not found. If I hit the URL with query string PROJ1-PLAN1-JOB1, that works fine.
Also, I tried injecting variables but they are not accessible too from within atlassian-plugin.xml
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see, sorry I misread your question - to further clarify the issue:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Sorry for the confusion, but ${buildKey} returns value as 'PROJ1-PLAN1'.
2. Yes, this problem occurs in 5.9.7. So when tried same on 6.5.0, ${buildKey} returns same PROJ1-PLAN1, but it renders the contents of the action correctly, while in 5.9.7, URL built using this value says, PROJ1-PLAN1 not found i.e.<PLAN_KEY> not found. And on manually changing the URL to PROJ1-PLAN1-JOB1, it renders the contents of the action web item. On 6.5.0, contents are rendered correctly for both values w/ and w/o JOB1.
So I was searching for some bamboo variable which will give me value PROJ1-PLAN1-JOB1, but I tried almost all available in documentation, but none of them works as required. Also I am not sure, but can this issue be due to change in directory structure for the artifacts which was introduced post 5.9.?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My web item action is the ViewBuildResults calss which is used to render some reports generated during build step.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.