cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
cchueng
Level III

Open a table from Atlassian page

How do I write a script to open a table that is on an Atlassian Page ? I tried below

dt = open("https://impinj.atlassian.net/wiki/spaces/UNI/pages/79855941/12+AOI+Disposition-2022", html table(1));

 

I am using JMP17.

error msg.PNG

4 REPLIES 4
Thierry_S
Super User

Re: Open a table from Atlassian page

Hi,

I could not test your problem because the link in your question requires a password.

I am unfamiliar with using the OPEN command to directly import the content of a web page as a data table. Are you sure that it is the right method? If you are, there might be an issue with your access privilege for that specific page.

If you are not, I suggest using the manual method described below to assess if the page can be downloaded as a data table.

 

To import data from the internet or a remote computer as a data table in JMP, you can:
  1. Select File > Internet Open and select the file
  2. Click the Import as Data Table icon in the upper right corner of the JMP browser
  3. A window appears that lists the tables found in the web page
  4. Select the table or tables that you want to import
  5. Click OK

Let us know what you find.

Best,

TS 

 
 
Thierry R. Sornasse
cchueng
Level III

Re: Open a table from Atlassian page

Hello Thierry,

I could not open the table using your method. There is a table on the webpage but it says it could not find it.

cchueng_0-1692671730861.png

 

Craige_Hales
Super User

Re: Open a table from Atlassian page

JMP could not find <table> elements in the html it received. Maybe one of these:

  1. The apparent table is formatted without using <table> elements
  2. The site requires a login and JMP is seeing the login page
  3. Wrong URL and JMP is seeing an error or other page

Open the table in a browser and use the right-click->view source option to see if there are <table>, <tr>, and <td> elements in the html. <tr>...</tr> for each row and <td>...</td> for each data value.

Try

write(loadtextfile("https://..."))

and check the log. Study the html to see if it looks like your table or an error message or a login prompt.

I'm pretty sure JMP is seeing the login page, not the page with the table.

If this is a one time download, @Thierry_S  has the best answer:

Pick the web page option.Pick the web page option.Login, go to the page you need, then the high lighted button.Login, go to the page you need, then the high lighted button.

If you need to script this for many runs...

There is a good chance the site has an API to help you fetch the data, possibly as a .CSV file. https://developer.atlassian.com/  That API will also have a way to provide your credentials to use the site. JMP's httprequest will help if you go that route. This is the best choice. You may need the NewOAuth2 example from the scripting index to help figure this out; it shows how the credential process might work. @bryan_boone 

Or, something like Browser Scripting with Python Selenium  will let you write JSL+Python to navigate the site. Complicated, this is not the best choice if an API is available.

 

Craige

Re: Open a table from Atlassian page

Much of the data in Atlassian (Confluence and Jira) is non-tabular and has customizable fields. In short, it's JSON, at least from the REST endpoint perspective.

The easiest way to get started is by creating a Personal Access Token (PAT) in your Atlassian. I did a while back (as you can see from the screen shot) but I still had to hunt around for it
https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html

bryan_boone_0-1692798084122.png

In my case, I used JMP to track Jira's for me (read only)

I used Jira's REST api v2
https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#about

 

The key thing to remember is that every REST call will need the API token like:

PAT_TOKEN = "";
JIRA_URL = "https://rndjira.mine/rest/api/2";
JIRA_USER = "";
user = Encode URI( JIRA_USER );
query = "startAt=0&maxResults=500&jql=assignee=" || user;
url = JIRA_URL || "/search?" || query;

request = New HTTPRequest (
	Headers({"Authorization: Bearer " || PAT_TOKEN}),
	Method( "GET" ),
	URL( url )
);

json = request << Send;

json_aa = [=>];
If( request << Is Successful(),
	json_aa = Parse JSON( json );
);

json_aa is the returned JSON parsed into a JSL Associative Array.

You may want to do something like:

write("!\n" || Char(json) || "!\n");

And put the output into a JSON Editor so you can see the returned JSON data structure.