Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to extract parent_id field? #217

Open
sciancio opened this issue May 29, 2019 · 12 comments
Open

How to extract parent_id field? #217

sciancio opened this issue May 29, 2019 · 12 comments

Comments

@sciancio
Copy link

Is it possible to extract parent_id field? I view this field ("parent link") disabled among "Configure custom fields".

Thanks.

@sciancio sciancio added the bug label May 29, 2019
@ljay79
Copy link
Owner

ljay79 commented May 29, 2019

Where would you need to use it? In custom functions (here you can use the actual Jira field id) or in the "List issues from filter" via the dialog?

I could certainly look into that one, if im able to implement support for that field (wont be able to do so before June 10 - due to vacation)

@ljay79 ljay79 added enhancement and removed bug labels May 29, 2019
@sciancio
Copy link
Author

I create a table via "List issue from filter". I'd like a column with the parent id link of subtask.
If it is possible to extract it in any other way, suggestions are welcome.
Thanks for this work.

@ljay79
Copy link
Owner

ljay79 commented May 29, 2019

With the custom function JST_search() it would be possible. With the dialog "list issues from filter" not yet.

@sciancio
Copy link
Author

It would be nice to have parent id extracted via "List issue from filter". It would be even better if the order of the rows extracted could be customized to highlight the connection between task (parent) / subtask. For example:
Row 1: task 1, n/a
Row 2: subtask 1, task 1, ...
Row 3: subtask 2, task 1, ...
Row 4: subtask 3, task 1, ...
Row 5: task 2, n/a
Row 6: subtask 4, task 2, ...
Row 7: subtask 5, task 2, ...
...

@ljay79
Copy link
Owner

ljay79 commented Jun 14, 2019

I researched a little deep. Apparently "Parent Link" is a licensed field from Jira Portfolio.
I do not have that feature and are unable to get details on the JSON representations for the fields value.

Could you activate the add-ons debugging in the "About" dialog, provide me the "Temp. User Key" and perform following actions while debugging is "On".

  • open menu -> "Jira field map"
  • locate the ID of your field "Parent Link"; looks like "customfield_12345"
  • then perform a small search in any cell ie: JST_search("status = Done"; "key,customfield_12345"; 5)
    • using the retrieved field ID instead of the sample "customfield_12345"

This should provide me with enough JSON debug info in my logs to dive depper.

@ljay79
Copy link
Owner

ljay79 commented Jun 14, 2019

BTW: The customization and sorting of the resulting list as suggested i wont be able to implement.
In best case, i will be able to add support for the "Parent Link" field so i would show up in all retrieved IssueTables.

@sciancio
Copy link
Author

Done. The temporary user key is AANBUuWRvQvd32enqPKLqSQfEQSqDKVJNOj69374OMJ2IQo6s1v1uY+DVjNw4hhd74x2yvH1ZigQ

Thanks.

@ljay79
Copy link
Owner

ljay79 commented Jun 14, 2019

Hi @sciancio

thanks for the info. I had a look at the JSON responses from your JIRA queries.
Your requests do actually return the same values as on my instance.
Its does not return actual values for that field as it isnt licensed apparently.

Actual sample response from your query:

{
	"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
	"id": "34753",
	"self": "https://XXXX.atlassian.net/rest/api/2/issue/34753",
	"key": "VSHO-81",
	"fields": {
		"customfield_10511": {
			"hasEpicLinkFieldDependency": false,
			"showField": false,
			"nonEditableReason": {
				"reason": "PLUGIN_LICENSE_ERROR",
				"message": "Portfolio for Jira must be licensed for the Parent Link to be available."
			}
		}
	}
}

Im not familiar with that Jira add-on "Portfolio" but i wonder how you can use it within Jira itself if it isnt apparently activated/available due to licensing?

@ljay79
Copy link
Owner

ljay79 commented Jun 14, 2019

Oh, maybe it depends on the issue you query for.
Can you do the same procedure again but this time, query a specific Jira issue where you know for sure, it has a value for the "Parent Link" field.

ie: JST_search("key = VSHO-XX"; "key,customfield_10511"; 1)
Replace VSHO-XX with an existing issue key id from your Jira, where you can confirm it has a value for "Parent Link".

@sciancio
Copy link
Author

Done. Same key.

@ljay79
Copy link
Owner

ljay79 commented Jun 14, 2019

Sorry to say, but same problem on Jira side:

{
		"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
		"id": "38346",
		"self": "https://XXXXX.atlassian.net/rest/api/2/issue/38346",
		"key": "ROS-73",
		"fields": {
			"customfield_10511": {
				"hasEpicLinkFieldDependency": false,
				"showField": false,
				"nonEditableReason": {
					"reason": "PLUGIN_LICENSE_ERROR",
					"message": "Portfolio for Jira must be licensed for the Parent Link to be available."
				}
			}
		}
	}

At this point, im not sure how i would be able to have the google add-on able to retrieve the requested info from "Parent Link".

@VinodParmar
Copy link

VinodParmar commented Dec 29, 2020

Hi @sciancio

thanks for the info. I had a look at the JSON responses from your JIRA queries.
Your requests do actually return the same values as on my instance.
Its does not return actual values for that field as it isnt licensed apparently.

Actual sample response from your query:

{
	"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
	"id": "34753",
	"self": "https://XXXX.atlassian.net/rest/api/2/issue/34753",
	"key": "VSHO-81",
	"fields": {
		"customfield_10511": {
			"hasEpicLinkFieldDependency": false,
			"showField": false,
			"nonEditableReason": {
				"reason": "PLUGIN_LICENSE_ERROR",
				"message": "Portfolio for Jira must be licensed for the Parent Link to be available."
			}
		}
	}
}

Im not familiar with that Jira add-on "Portfolio" but i wonder how you can use it within Jira itself if it isnt apparently activated/available due to licensing?

Yes this is problem if Jira side.
But you can solve another way by below code.

dynamic jsonObj = JsonConvert.DeserializeObject(json);
JObject jsonObject = jsonObj?.issue as JObject;
string parentkey =Convert.ToString(jsonObject["fields"]?["customfield_10018"]?["data"]?["key"]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants